Skip to content

Commit f77b5da

Browse files
teurwing328
authored andcommitted
Remove deprecated API use of ObjectFactory.property() (#2613) (#4352)
1 parent ea60098 commit f77b5da

File tree

5 files changed

+22
-20
lines changed

5 files changed

+22
-20
lines changed

modules/openapi-generator-gradle-plugin/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.61'
2+
ext.kotlin_version = '1.3.20'
33
repositories {
44
mavenLocal()
55
mavenCentral()
@@ -15,7 +15,7 @@ buildscript {
1515
}
1616
dependencies {
1717
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
18-
classpath "gradle.plugin.org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.0-rc-3"
18+
classpath "gradle.plugin.org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.1.3"
1919
classpath "com.gradle.publish:plugin-publish-plugin:0.10.1"
2020
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.20.0"
2121
classpath "de.marcphilipp.gradle:nexus-publish-plugin:0.2.0"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://downloads.gradle.org/distributions/gradle-4.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

modules/openapi-generator-gradle-plugin/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<properties>
1919
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
20-
<gradleVersion>4.10.2</gradleVersion>
20+
<gradleVersion>5.2.1</gradleVersion>
2121
</properties>
2222

2323
<pluginRepositories>

modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt

+9-8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package org.openapitools.generator.gradle.plugin.extensions
1818

1919
import org.gradle.api.Project
2020
import org.gradle.kotlin.dsl.listProperty
21+
import org.gradle.kotlin.dsl.mapProperty
2122
import org.gradle.kotlin.dsl.property
2223

2324
/**
@@ -66,7 +67,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
6667
/**
6768
* Sets specified system properties.
6869
*/
69-
val systemProperties = project.objects.property<Map<String, String>>()
70+
val systemProperties = project.objects.mapProperty<String, String>()
7071

7172
/**
7273
* Path to json configuration file.
@@ -108,22 +109,22 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
108109
/**
109110
* Sets instantiation type mappings.
110111
*/
111-
val instantiationTypes = project.objects.property<Map<String, String>>()
112+
val instantiationTypes = project.objects.mapProperty<String, String>()
112113

113114
/**
114115
* Sets mappings between OpenAPI spec types and generated code types.
115116
*/
116-
val typeMappings = project.objects.property<Map<String, String>>()
117+
val typeMappings = project.objects.mapProperty<String, String>()
117118

118119
/**
119120
* Sets additional properties that can be referenced by the mustache templates.
120121
*/
121-
val additionalProperties = project.objects.property<Map<String, String>>()
122+
val additionalProperties = project.objects.mapProperty<String, String>()
122123

123124
/**
124125
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
125126
*/
126-
val serverVariables = project.objects.property<Map<String, String>>()
127+
val serverVariables = project.objects.mapProperty<String, String>()
127128

128129
/**
129130
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
@@ -133,7 +134,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
133134
/**
134135
* Specifies mappings between a given class and the import that should be used for that class.
135136
*/
136-
val importMappings = project.objects.property<Map<String, String>>()
137+
val importMappings = project.objects.mapProperty<String, String>()
137138

138139
/**
139140
* Root package for generated code.
@@ -188,7 +189,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
188189
/**
189190
* Specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used.
190191
*/
191-
val reservedWordsMappings = project.objects.property<Map<String, String>>()
192+
val reservedWordsMappings = project.objects.mapProperty<String, String>()
192193

193194
/**
194195
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
@@ -304,7 +305,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
304305
/**
305306
* A map of options specific to a generator.
306307
*/
307-
val configOptions = project.objects.property<Map<String, String>>()
308+
val configOptions = project.objects.mapProperty<String, String>()
308309

309310
init {
310311
applyDefaults()

modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt

+9-8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import org.gradle.api.tasks.TaskAction
2424
import org.gradle.internal.logging.text.StyledTextOutput
2525
import org.gradle.internal.logging.text.StyledTextOutputFactory
2626
import org.gradle.kotlin.dsl.listProperty
27+
import org.gradle.kotlin.dsl.mapProperty
2728
import org.gradle.kotlin.dsl.property
2829
import org.openapitools.codegen.CodegenConstants
2930
import org.openapitools.codegen.DefaultGenerator
@@ -90,7 +91,7 @@ open class GenerateTask : DefaultTask() {
9091
* Sets specified system properties.
9192
*/
9293
@get:Internal
93-
val systemProperties = project.objects.property<Map<String, String>>()
94+
val systemProperties = project.objects.mapProperty<String, String>()
9495

9596
/**
9697
* Path to json configuration file.
@@ -140,27 +141,27 @@ open class GenerateTask : DefaultTask() {
140141
* Sets instantiation type mappings.
141142
*/
142143
@get:Internal
143-
val instantiationTypes = project.objects.property<Map<String, String>>()
144+
val instantiationTypes = project.objects.mapProperty<String, String>()
144145

145146
/**
146147
* Sets mappings between OpenAPI spec types and generated code types.
147148
*/
148149
@get:Internal
149-
val typeMappings = project.objects.property<Map<String, String>>()
150+
val typeMappings = project.objects.mapProperty<String, String>()
150151

151152
/**
152153
* Sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value.
153154
* You can also have multiple occurrences of this option.
154155
*/
155156
@get:Internal
156-
val additionalProperties = project.objects.property<Map<String, String>>()
157+
val additionalProperties = project.objects.mapProperty<String, String>()
157158

158159
/**
159160
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
160161
* You can also have multiple occurrences of this option.
161162
*/
162163
@get:Internal
163-
val serverVariables = project.objects.property<Map<String, String>>()
164+
val serverVariables = project.objects.mapProperty<String, String>()
164165

165166
/**
166167
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
@@ -172,7 +173,7 @@ open class GenerateTask : DefaultTask() {
172173
* Specifies mappings between a given class and the import that should be used for that class.
173174
*/
174175
@get:Internal
175-
val importMappings = project.objects.property<Map<String, String>>()
176+
val importMappings = project.objects.mapProperty<String, String>()
176177

177178
/**
178179
* Root package for generated code.
@@ -238,7 +239,7 @@ open class GenerateTask : DefaultTask() {
238239
* Specifies how a reserved name should be escaped to.
239240
*/
240241
@get:Internal
241-
val reservedWordsMappings = project.objects.property<Map<String, String>>()
242+
val reservedWordsMappings = project.objects.mapProperty<String, String>()
242243

243244
/**
244245
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
@@ -372,7 +373,7 @@ open class GenerateTask : DefaultTask() {
372373
* A dynamic map of options specific to a generator.
373374
*/
374375
@get:Internal
375-
val configOptions = project.objects.property<Map<String, String>>()
376+
val configOptions = project.objects.mapProperty<String, String>()
376377

377378
private fun <T : Any?> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
378379
if (isPresent) {

0 commit comments

Comments
 (0)