Change Gradle property to "rename" (#528)

This changes the property to match the name of the CLI flag.
This commit is contained in:
Daniel Chao
2024-06-14 07:36:28 -07:00
committed by GitHub
parent 9c287a2e48
commit 380095c8a7
8 changed files with 15 additions and 15 deletions

View File

@@ -412,7 +412,7 @@ public class PklPlugin implements Plugin<Project> {
task.getOutputDir().set(spec.getOutputDir());
task.getGenerateSpringBootConfig().set(spec.getGenerateSpringBootConfig());
task.getImplementSerializable().set(spec.getImplementSerializable());
task.getPackageMapping().set(spec.getPackageMapping());
task.getRenames().set(spec.getRenames());
}
private <T extends BasePklTask, S extends BasePklSpec> void configureBaseTask(T task, S spec) {

View File

@@ -32,5 +32,5 @@ public interface CodeGenSpec extends ModulesSpec {
Property<Boolean> getImplementSerializable();
MapProperty<String, String> getPackageMapping();
MapProperty<String, String> getRenames();
}

View File

@@ -35,5 +35,5 @@ public abstract class CodeGenTask extends ModulesTask {
public abstract Property<Boolean> getImplementSerializable();
@Input
public abstract MapProperty<String, String> getPackageMapping();
public abstract MapProperty<String, String> getRenames();
}

View File

@@ -53,7 +53,7 @@ public abstract class JavaCodeGenTask extends CodeGenTask {
getParamsAnnotation().getOrNull(),
getNonNullAnnotation().getOrNull(),
getImplementSerializable().get(),
getPackageMapping().get()))
getRenames().get()))
.run();
}
}

View File

@@ -38,7 +38,7 @@ public abstract class KotlinCodeGenTask extends CodeGenTask {
getGenerateKdoc().get(),
getGenerateSpringBootConfig().get(),
getImplementSerializable().get(),
getPackageMapping().get()))
getRenames().get()))
.run();
}
}

View File

@@ -113,7 +113,7 @@ class JavaCodeGeneratorsTest : AbstractTest() {
paramsAnnotation = "javax.inject.Named"
nonNullAnnotation = "javax.annotation.Nonnull"
settingsModule = "pkl:settings"
packageMapping = [
renames = [
'org': 'foo.bar'
]
}

View File

@@ -125,7 +125,7 @@ class KotlinCodeGeneratorsTest : AbstractTest() {
sourceModules = ["mod.pkl"]
outputDir = file("build/generated")
settingsModule = "pkl:settings"
packageMapping = [
renames = [
'org.': 'foo.bar.'
]
}