package io.freefair.gradle.plugins.lombok;

import lombok.Getter;
import lombok.Setter;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.MapProperty;
import org.gradle.api.provider.Property;
import org.gradle.internal.deprecation.DeprecationLogger;

import javax.inject.Inject;

/**
 * @author Lars Grefer
 * @see LombokPlugin
 */
@Getter
@Setter
public class LombokExtension {

    public static final String LOMBOK_VERSION = "1.18.24";

    /**
     * The version of Lombok which will be used.
     */
    private final Property<String> version;

    /**
     * Additional Entries for the lombok.config file.
     */
    @Deprecated
    private final MapProperty<String, String> config;

    private final Property<Boolean> disableConfig;

    @Inject
    public LombokExtension(ObjectFactory objectFactory) {
        version = objectFactory.property(String.class).convention(LOMBOK_VERSION);
        config = objectFactory.mapProperty(String.class, String.class);
        disableConfig = objectFactory.property(Boolean.class);

        disableConfig.convention(System.getProperty("lombok.disableConfig") != null);
    }

    @Deprecated
    public MapProperty<String, String> getConfig() {
        DeprecationLogger.deprecateProperty(LombokExtension.class, "config")
                .willBeRemovedInGradle8()
                .undocumented()
                .nagUser();
        return config;
    }
}

@@ -155,19 +155,16 @@
 rovider.
-Map
 Property
@@ -168,107 +168,8 @@
 rty;
-%0Aimport org.gradle.api.provider.Property;%0Aimport org.gradle.internal.deprecation.DeprecationLogger;
 %0A%0Aim
@@ -469,149 +469,8 @@
 n;%0A%0A
-    /**%0A     * Additional Entries for the lombok.config file.%0A     */%0A    @Deprecated%0A    private final MapProperty%3CString, String%3E config;%0A%0A
     
@@ -674,80 +674,8 @@
 N);%0A
-        config = objectFactory.mapProperty(String.class, String.class);%0A
     
@@ -829,285 +829,7 @@
    %7D
-%0A%0A    @Deprecated%0A    public MapProperty%3CString, String%3E getConfig() %7B%0A        DeprecationLogger.deprecateProperty(LombokExtension.class, %22config%22)%0A                .willBeRemovedInGradle8()%0A                .undocumented()%0A                .nagUser();%0A        return config;%0A    %7D
 %0A%7D%0A

Remove deprecated lombok.config field