Skip to content

Commit

Permalink
Use simple property assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 authored and topjohnwu committed Jul 12, 2024
1 parent 0185ddf commit ea4cabd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions buildSrc/src/main/java/Setup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.StopExecutionException
import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.exclude
import org.gradle.kotlin.dsl.filter
import org.gradle.kotlin.dsl.get
Expand Down Expand Up @@ -103,7 +104,7 @@ fun Project.setupCommon() {

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
jvmTarget = JvmTarget.JVM_17
}
}
}
Expand Down Expand Up @@ -302,12 +303,12 @@ fun Project.setupAppCommon() {
.toTransformMany(SingleArtifact.APK)
val signingConfig = androidApp.buildTypes.getByName(variant.buildType!!).signingConfig
commentTask.configure {
this.transformationRequest.set(transformationRequest)
this.signingConfig.set(signingConfig)
this.comment.set("version=${Config.version}\n" +
this.transformationRequest = transformationRequest
this.signingConfig = signingConfig
this.comment = "version=${Config.version}\n" +
"versionCode=${Config.versionCode}\n" +
"stubVersion=${Config.stubVersion}\n")
this.outFolder.set(layout.buildDirectory.dir("outputs/apk/${variant.name}"))
"stubVersion=${Config.stubVersion}\n"
this.outFolder = layout.buildDirectory.dir("outputs/apk/${variant.name}")
}
}
}
Expand All @@ -321,9 +322,9 @@ fun Project.setupStub() {
val manifestUpdater =
project.tasks.register("${variantName}ManifestProducer", ManifestUpdater::class.java) {
dependsOn("generate${variantCapped}ObfuscatedClass")
applicationId.set(variant.applicationId)
appClassDir.set(layout.buildDirectory.dir("generated/source/app/$variantName"))
factoryClassDir.set(layout.buildDirectory.dir("generated/source/factory/$variantName"))
applicationId = variant.applicationId
appClassDir = layout.buildDirectory.dir("generated/source/app/$variantName")
factoryClassDir = layout.buildDirectory.dir("generated/source/factory/$variantName")
}
variant.artifacts.use(manifestUpdater)
.wiredWithFiles(
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
google()
mavenCentral()
Expand Down

0 comments on commit ea4cabd

Please sign in to comment.