Skip to content

Commit 064824e

Browse files
authored
Use kotlin script for buildSrc gradle file. (#3999)
* Use kotlin script for buildSrc gradle file. * Fix build-src workflow * address review comment. * address review comments. * cleanup
1 parent 4eea47f commit 064824e

File tree

4 files changed

+108
-119
lines changed

4 files changed

+108
-119
lines changed

.github/workflows/build-src-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
env:
3232
FIREBASE_CI: 1
3333
run: |
34-
./gradlew -b buildSrc/build.gradle -PenablePluginTests=true check
34+
./gradlew -b buildSrc/build.gradle.kts -PenablePluginTests=true check
3535
- name: Publish Test Results
3636
uses: EnricoMi/publish-unit-test-result-action@v1
3737
with:

buildSrc/build.gradle

Lines changed: 0 additions & 117 deletions
This file was deleted.

buildSrc/build.gradle.kts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// Copyright 2018 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
plugins {
16+
id("org.jlleitschuh.gradle.ktlint") version "9.2.1"
17+
id("com.github.sherter.google-java-format") version "0.9"
18+
`kotlin-dsl`
19+
}
20+
21+
repositories {
22+
mavenLocal()
23+
maven(url = "https://maven.google.com/")
24+
mavenCentral()
25+
maven(url = "https://storage.googleapis.com/android-ci/mvn/")
26+
maven(url = "https://plugins.gradle.org/m2/")
27+
}
28+
29+
// Refer latest "perf-plugin" released version on https://maven.google.com/web/index.html?q=perf-plugin#com.google.firebase:perf-plugin
30+
// The System property allows us to integrate with an unreleased version from https://bityl.co/3oYt.
31+
// Refer go/fireperf-plugin-test-on-head for more details.
32+
val perfPluginVersion = System.getenv("FIREBASE_PERF_PLUGIN_VERSION") ?: "1.4.1"
33+
34+
googleJavaFormat {
35+
toolVersion = "1.10.0"
36+
}
37+
38+
dependencies {
39+
// Firebase performance plugin, it should be added here because of how gradle dependency
40+
// resolution works, otherwise it breaks Fireperf Test Apps.
41+
// See https://github.com/gradle/gradle/issues/12286
42+
implementation("com.google.firebase:perf-plugin:$perfPluginVersion")
43+
44+
implementation("com.google.auto.value:auto-value-annotations:1.8.1")
45+
annotationProcessor("com.google.auto.value:auto-value:1.6.5")
46+
implementation("digital.wup:android-maven-publish:3.6.3")
47+
implementation(kotlin("gradle-plugin", "1.4.32"))
48+
implementation("org.json:json:20210307")
49+
50+
implementation("org.eclipse.aether:aether-api:1.0.0.v20140518")
51+
implementation("org.eclipse.aether:aether-util:1.0.0.v20140518")
52+
implementation("org.eclipse.aether:aether-impl:1.0.0.v20140518")
53+
implementation("org.eclipse.aether:aether-connector-basic:1.0.0.v20140518")
54+
implementation("org.eclipse.aether:aether-transport-file:1.0.0.v20140518")
55+
implementation("org.eclipse.aether:aether-transport-http:1.0.0.v20140518")
56+
implementation("org.eclipse.aether:aether-transport-wagon:1.0.0.v20140518")
57+
implementation("org.apache.maven:maven-aether-provider:3.1.0")
58+
59+
implementation("com.google.code.gson:gson:2.8.9")
60+
implementation("org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.17-g013-9b8280a")
61+
implementation("com.android.tools.build:gradle:3.4.3")
62+
implementation("gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9")
63+
64+
testImplementation("junit:junit:4.13.2")
65+
testImplementation("com.google.truth:truth:1.1.2")
66+
testImplementation("commons-io:commons-io:2.6")
67+
}
68+
69+
gradlePlugin {
70+
plugins {
71+
register("licensePlugin") {
72+
id = "LicenseResolverPlugin"
73+
implementationClass = "com.google.firebase.gradle.plugins.license.LicenseResolverPlugin"
74+
}
75+
register("multiProjectReleasePlugin") {
76+
id = "MultiProjectReleasePlugin"
77+
implementationClass = "com.google.firebase.gradle.MultiProjectReleasePlugin"
78+
}
79+
register("publishingPlugin") {
80+
id = "PublishingPlugin"
81+
implementationClass = "com.google.firebase.gradle.plugins.publish.PublishingPlugin"
82+
}
83+
register("firebaseLibraryPlugin") {
84+
id = "firebase-library"
85+
implementationClass = "com.google.firebase.gradle.plugins.FirebaseLibraryPlugin"
86+
}
87+
88+
register("firebaseJavaLibraryPlugin") {
89+
id = "firebase-java-library"
90+
implementationClass = "com.google.firebase.gradle.plugins.FirebaseJavaLibraryPlugin"
91+
}
92+
93+
register("firebaseVendorPlugin") {
94+
id = "firebase-vendor"
95+
implementationClass = "com.google.firebase.gradle.plugins.VendorPlugin"
96+
}
97+
}
98+
}
99+
100+
tasks.withType<Test> {
101+
testLogging {
102+
// Make sure output from standard out or error is shown in Gradle output.
103+
showStandardStreams = true
104+
}
105+
val enablePluginTests: String? by rootProject
106+
enabled = enablePluginTests == "true"
107+
}

buildSrc/settings.gradle renamed to buildSrc/settings.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-

0 commit comments

Comments
 (0)