-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update AGP to
8.1.4
, upgrade 8.1.1
and update both Gradle/Bazel t…
- Loading branch information
1 parent
e3a1295
commit 8bf9cc0
Showing
50 changed files
with
509 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: | |
- master | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
TERM: dumb | ||
|
||
|
@@ -14,12 +18,12 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install JDK 11 | ||
uses: actions/setup-java@v2 | ||
uses: actions/checkout@v4 | ||
- name: Install JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
java-version: "17" | ||
- name: Lint | ||
run: | | ||
find "$(pwd -P)" -type f \ | ||
|
@@ -29,7 +33,7 @@ jobs: | |
bazel-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Bazel build | ||
uses: ./.github/actions/bazel | ||
with: | ||
|
@@ -38,7 +42,7 @@ jobs: | |
bazel-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Query targets | ||
run: | | ||
bazelisk query 'kind(kt_jvm_test, ...)' --output label > /tmp/targets | ||
|
@@ -51,7 +55,7 @@ jobs: | |
bazel-android-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Bazel Android Lint | ||
uses: ./.github/actions/bazel | ||
with: | ||
|
@@ -61,7 +65,12 @@ jobs: | |
grazel-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Install JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
- uses: burrunan/[email protected] | ||
name: grazel-build | ||
with: | ||
|
@@ -75,7 +84,12 @@ jobs: | |
grazel-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Install JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
- uses: burrunan/[email protected] | ||
name: grazel-test | ||
with: | ||
|
@@ -89,7 +103,12 @@ jobs: | |
grazel-gradle-plugin-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Install JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
- uses: burrunan/[email protected] | ||
name: grazel-gradle-plugin-test | ||
with: | ||
|
@@ -104,14 +123,14 @@ jobs: | |
migrate-to-bazel-validation: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Setup Bazelisk | ||
uses: bazelbuild/setup-bazelisk@v2 | ||
- name: Install JDK 11 | ||
- name: Install JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
java-version: "17" | ||
- uses: burrunan/[email protected] | ||
name: migrate-to-bazel-validation | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gradle.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gradlew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../gradlew.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
plugins { | ||
`java-gradle-plugin` | ||
`kotlin-dsl` | ||
alias(libs.plugins.ksp) // KSP | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(17) | ||
explicitApi() | ||
} | ||
|
||
gradlePlugin { | ||
val build by plugins.creating { | ||
id = "com.grab.grazel.build.common" | ||
implementationClass = "com.grab.grazel.build.BuildLogicPlugin" | ||
} | ||
} | ||
|
||
dependencies { | ||
/* implementation(libs.coroutines) | ||
implementation(libs.coroutines.jvm)*/ | ||
compileOnly(libs.android.gradle.plugin) | ||
compileOnly(libs.kotlin.gradle.plugin) | ||
|
||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") | ||
testRuntimeOnly("org.junit.platform:junit-platform-launcher") | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useJUnitPlatform() | ||
} |
25 changes: 25 additions & 0 deletions
25
build-logic/plugin/src/main/kotlin/com/grab/grazel/build/BuildLogicPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2024 Grabtaxi Holdings PTE LTD (GRAB) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.grab.grazel.build | ||
|
||
import com.grab.grazel.build.android.configureAndroid | ||
import com.grab.grazel.build.gradle.ConfigurablePlugin | ||
import com.grab.grazel.build.jvm.configureJvm | ||
|
||
public class BuildLogicPlugin : ConfigurablePlugin({ | ||
configureJvm() | ||
configureAndroid() | ||
}) |
56 changes: 56 additions & 0 deletions
56
build-logic/plugin/src/main/kotlin/com/grab/grazel/build/android/Android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2024 Grabtaxi Holdings PTE LTD (GRAB) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.grab.grazel.build.android | ||
|
||
import com.android.build.api.variant.AndroidComponentsExtension | ||
import com.android.build.api.variant.ApplicationAndroidComponentsExtension | ||
import com.android.build.api.variant.DynamicFeatureAndroidComponentsExtension | ||
import com.android.build.api.variant.LibraryAndroidComponentsExtension | ||
import com.android.build.api.variant.TestAndroidComponentsExtension | ||
import com.android.build.api.variant.Variant | ||
import com.android.build.api.variant.VariantBuilder | ||
import com.android.build.gradle.BaseExtension | ||
import com.android.build.gradle.LintPlugin | ||
import com.grab.grazel.build.gradle.configureIfExist | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.withType | ||
import com.android.build.gradle.BasePlugin as AndroidBasePlugin | ||
|
||
internal fun Project.android(builder: BaseExtension.() -> Unit) { | ||
configure(builder) | ||
} | ||
|
||
internal fun Project.androidComponents( | ||
builder: AndroidComponentsExtension<*, out VariantBuilder, out Variant>.() -> Unit | ||
) { | ||
configureIfExist<LibraryAndroidComponentsExtension>(builder) | ||
configureIfExist<ApplicationAndroidComponentsExtension>(builder) | ||
configureIfExist<TestAndroidComponentsExtension>(builder) | ||
configureIfExist<DynamicFeatureAndroidComponentsExtension>(builder) | ||
} | ||
|
||
internal fun Project.configureAndroid() { | ||
require(this == rootProject) { "Should be only called from root project" } | ||
subprojects { | ||
plugins.withType<AndroidBasePlugin> { | ||
if (this !is LintPlugin) { | ||
androidCommon() | ||
} | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
build-logic/plugin/src/main/kotlin/com/grab/grazel/build/android/AndroidCommon.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2024 Grabtaxi Holdings PTE LTD (GRAB) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.grab.grazel.build.android | ||
|
||
import com.grab.grazel.build.gradle.libs | ||
import com.grab.grazel.build.gradle.version | ||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.Project | ||
|
||
internal fun Project.androidCommon() { | ||
android { | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
defaultConfig { | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = libs.version("androidx.compose")!! | ||
} | ||
|
||
packagingOptions { | ||
resources.excludes += listOf( | ||
"META-INF/AL2.0", | ||
"META-INF/LGPL2.1", | ||
"META-INF/licenses/**" | ||
) | ||
} | ||
|
||
lintOptions { | ||
lintConfig = rootProject.file("lint.xml") | ||
} | ||
} | ||
|
||
androidComponents { | ||
beforeVariants(selector().withBuildType("release")) { | ||
it.enable = false | ||
} | ||
} | ||
} |
Oops, something went wrong.