Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

env:
USE_AGP_VERSION: '8.13.0'
USE_AGP_VERSION: '9.0.0-beta04'
USE_JAVA_DISTRIBUTION: 'zulu'
USE_JAVA_VERSION_FOR_BAZEL: '21'
USE_JAVA_VERSION_FOR_GRADLE: '21'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

env:
USE_AGP_VERSION: '8.13.0'
USE_AGP_VERSION: '9.0.0-beta04'
USE_JAVA_DISTRIBUTION: 'zulu'
USE_JAVA_VERSION_FOR_BAZEL: '21'
USE_JAVA_VERSION_FOR_GRADLE: '21'
Expand Down
10 changes: 5 additions & 5 deletions java/dagger/hilt/android/plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {
kotlin_version = "2.2.0"
agp_version = System.getenv('AGP_VERSION')
agp_version = System.getenv('AGP_VERSION') ?: "9.0.0-beta04"
ksp_version = "$kotlin_version-2.0.2"
pluginArtifactId = 'hilt-android-gradle-plugin'
pluginId = 'com.google.dagger.hilt.android'
Expand All @@ -12,7 +12,7 @@ plugins {
id 'org.jetbrains.kotlin.jvm' version "$kotlin_version"
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.gradleup.shadow' version '9.2.2'
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
}

Expand All @@ -24,10 +24,10 @@ allprojects {
}

// Avoids conflict with BUILD file
project.buildDir = 'buildOut'
project.layout.buildDirectory.set(file('buildOut'))

subprojects {
project.buildDir = 'buildOut'
subprojects {subproject ->
subproject.layout.buildDirectory.set(file('buildOut'))
afterEvaluate {
dependencies {
// This is needed to align older versions of kotlin-stdlib.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
20 changes: 11 additions & 9 deletions java/dagger/hilt/android/plugin/main/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
import dagger.hilt.android.plugin.task.ImportSharedLibTask
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id 'org.jetbrains.kotlin.jvm'
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.github.johnrengelman.shadow'
id 'com.gradleup.shadow'
}

configurations {
Expand Down Expand Up @@ -69,6 +68,7 @@ dependencies {
// Use compile-only for other plugin dependencies to avoid brining those
// to projects that don't use them.
compileOnly "com.android.tools.build:gradle:$agp_version"
compileOnly "com.android.legacy-kapt:com.android.legacy-kapt.gradle.plugin:$agp_version"
compileOnly "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
compileOnly "com.google.devtools.ksp:symbol-processing-gradle-plugin:$ksp_version"

Expand All @@ -81,6 +81,7 @@ dependencies {
testImplementation 'com.google.truth:truth:1.0.1'
testImplementation 'org.javassist:javassist:3.26.0-GA'
testPluginCompile "com.android.tools.build:gradle:$agp_version"
testPluginCompile "com.android.legacy-kapt:com.android.legacy-kapt.gradle.plugin:$agp_version"
testPluginCompile "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
testPluginCompile "com.google.devtools.ksp:symbol-processing-gradle-plugin:$ksp_version"
}
Expand Down Expand Up @@ -110,18 +111,19 @@ kotlin {
tasks.register("importSharedLib", ImportSharedLibTask) {
outputDir.set(file("${project.projectDir}/libs"))
}
tasks.getByName('compileKotlin').dependsOn('importSharedLib')
tasks.named('compileKotlin').configure { it.dependsOn('importSharedLib') }

// Task that generates a top-level property containing the version of the
// project so that it can be used in code and at runtime.
def pluginVersionOutDir = file("$buildDir/generated/source/plugin-version/")
def pluginVersionOutDir =
project.layout.buildDirectory.map {file("$it/generated/source/plugin-version/") }
tasks.register("generatePluginVersionSource").configure {
def version = getPublishVersion()
inputs.property('version', version)
outputs.dir(pluginVersionOutDir)
doLast {
def versionFile =
file("$pluginVersionOutDir/dagger/hilt/android/plugin/Version.kt")
file("${pluginVersionOutDir.get()}/dagger/hilt/android/plugin/Version.kt")
versionFile.parentFile.mkdirs()
versionFile.text = """
// Generated file. Do not edit!
Expand All @@ -132,14 +134,14 @@ tasks.register("generatePluginVersionSource").configure {
}
}
sourceSets.main.java.srcDir pluginVersionOutDir
tasks.getByName('compileKotlin').dependsOn('generatePluginVersionSource')
tasks.named('compileKotlin').configure { it.dependsOn('generatePluginVersionSource') }

// Create sources Jar from main kotlin sources
tasks.register("sourcesJar", Jar).configure {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles sources JAR"
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
from(sourceSets.named("main").map { it.allSource })
dependsOn('generatePluginVersionSource')
}

Expand All @@ -153,7 +155,7 @@ tasks.register("javadocJar", Jar).configure {
}

// Disable Gradle metadata publication.
tasks.withType(GenerateModuleMetadata) {
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}

Expand Down Expand Up @@ -254,7 +256,7 @@ def getPublishVersion() {
return (publishVersion != null) ? publishVersion : "LOCAL-SNAPSHOT"
}

def checkJarFile(File jarFile, String... allowedPrefixes) {
static def checkJarFile(File jarFile, String... allowedPrefixes) {
def zip = new ZipFile(jarFile)
try {
Enumeration<ZipEntry> list = zip.entries()
Expand Down
Loading
Loading