Skip to content

Commit

Permalink
fix: update plugin according to gradle api plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Aug 25, 2024
1 parent 7dc5354 commit 1de6c01
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ class GenerateJsonSchemaAndroidTask extends SourceTask {

void setTargetVersion(JsonSchemaExtension configuration) {
if (!configuration.targetVersion) {
if (project.plugins.hasPlugin("com.android.application")) {
configuration.targetVersion = project.plugins.getPlugin("com.android.application").extension.compileOptions.sourceCompatibility
logger.info 'Using android.compileOptions.sourceCompatibility as targetVersion for jsonschema2pojo: ' + configuration.targetVersion
} else if (project.plugins.hasPlugin("com.android.library")) {
configuration.targetVersion = project.plugins.getPlugin("com.android.library").extension.compileOptions.sourceCompatibility
if (project.hasProperty("android")) {
configuration.targetVersion = project.property("android").compileOptions.sourceCompatibility
logger.info 'Using android.compileOptions.sourceCompatibility as targetVersion for jsonschema2pojo: ' + configuration.targetVersion
}
}
Expand Down

0 comments on commit 1de6c01

Please sign in to comment.