Skip to content

Commit 2d2a5bf

Browse files
authored
chore: Release 2.0.0 (#38)
* fix: Use AndroidComponentsExtension from com.android.build.api.variant package. * chore: Adding GPR repo and 2.0.0-SNAPSHOT. * chore: Using AGP 7.0.0 and bump version to 2.0.0 * Define required params in gradle.properties.
1 parent 6c2b99e commit 2d2a5bf

File tree

7 files changed

+37
-32
lines changed

7 files changed

+37
-32
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
.externalNativeBuild
99
.cxx
1010
local.properties
11+
.java-version

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class and in the Android manifest file.
1212

1313
## Requirements
1414
* Gradle-based Android project
15-
* Android Gradle plugin 4.2.x
15+
* Android Gradle plugin 7.0.0
1616

1717
## Installation
1818

@@ -24,7 +24,7 @@ Groovy:
2424
```groovy
2525
buildscript {
2626
dependencies {
27-
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0"
27+
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
2828
}
2929
}
3030
```
@@ -33,7 +33,7 @@ Kotlin:
3333
```kotlin
3434
buildscript {
3535
dependencies {
36-
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0")
36+
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0")
3737
}
3838
}
3939
```

build.gradle

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = "1.4.32"
3+
ext.kotlin_version = "1.5.20"
44
repositories {
55
mavenLocal()
66
google()
77
mavenCentral()
8+
maven {
9+
url = uri("https://maven.pkg.github.com/google/secrets-gradle-plugin")
10+
credentials {
11+
username = project.findProperty("ghGprUser") ?: System.getenv("ghGprUser")
12+
password = project.findProperty("ghGprToken") ?: System.getenv("ghGprToken")
13+
}
14+
}
815
}
916
dependencies {
10-
classpath "com.android.tools.build:gradle:4.2.1"
17+
classpath "com.android.tools.build:gradle:7.0.0"
1118
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12-
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0"
19+
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
1320

1421
// NOTE: Do not place your application dependencies here; they belong
1522
// in the individual module build.gradle files

gradle.properties

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ android.enableJetifier=true
2121
kotlin.code.style=official
2222

2323
gradle.publish.key=
24-
gradle.publish.secret=
24+
gradle.publish.secret=
25+
26+
ghGprUser=
27+
ghGprToken=
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Thu Nov 26 22:14:52 PST 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

secrets-gradle-plugin/build.gradle.kts

+16-22
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
plugins {
1616
`java-gradle-plugin`
1717
`maven-publish`
18-
id("com.gradle.plugin-publish") version "0.12.0"
1918
id("kotlin")
2019
}
2120

@@ -25,9 +24,9 @@ java {
2524
}
2625

2726
dependencies {
28-
compileOnly("com.android.tools.build:gradle:4.2.1")
27+
compileOnly("com.android.tools.build:gradle:7.0.0")
2928
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10")
30-
testImplementation("com.android.tools.build:gradle:4.2.1")
29+
testImplementation("com.android.tools.build:gradle:7.0.0-beta04")
3130
testImplementation("junit:junit:4.13.1")
3231
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
3332
}
@@ -43,20 +42,6 @@ gradlePlugin {
4342
}
4443
}
4544

46-
pluginBundle {
47-
website = PluginInfo.url
48-
vcsUrl = PluginInfo.url
49-
description = PluginInfo.description
50-
version = PluginInfo.version
51-
52-
(plugins) {
53-
PluginInfo.name {
54-
displayName = PluginInfo.displayName
55-
tags = listOf("kotlin", "android")
56-
}
57-
}
58-
}
59-
6045
publishing {
6146
publications {
6247
create<MavenPublication>("mavenPub") {
@@ -98,18 +83,27 @@ publishing {
9883
}
9984
}
10085
repositories {
101-
maven(url = "build/repository")
86+
maven {
87+
name = "localPluginRepository"
88+
url = uri("build/repository")
89+
}
10290
mavenLocal()
10391
}
10492
}
10593

94+
project(":secrets-gradle-plugin") {
95+
version = PluginInfo.version
96+
}
97+
10698
object PluginInfo {
107-
const val artifactId = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin.gradle.plugin"
99+
const val artifactId =
100+
"com.google.android.libraries.mapsplatform.secrets-gradle-plugin.gradle.plugin"
108101
const val description = "A Gradle plugin for providing secrets securely to an Android project."
109102
const val displayName = "Secrets Gradle Plugin for Android"
110103
const val group = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin"
111-
const val implementationClass = "com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPlugin"
104+
const val implementationClass =
105+
"com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPlugin"
112106
const val name = "secretsGradlePlugin"
113107
const val url = "https://github.com/google/secrets-gradle-plugin"
114-
const val version = "1.3.0"
115-
}
108+
const val version = "2.0.0"
109+
}

secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
package com.google.android.libraries.mapsplatform.secrets_gradle_plugin
1818

19-
import com.android.build.api.extension.ApplicationAndroidComponentsExtension
20-
import com.android.build.api.extension.LibraryAndroidComponentsExtension
19+
import com.android.build.api.variant.ApplicationAndroidComponentsExtension
2120
import com.android.build.api.variant.BuildConfigField
21+
import com.android.build.api.variant.LibraryAndroidComponentsExtension
2222
import com.android.build.api.variant.Variant
2323
import com.android.build.gradle.AppExtension
2424
import com.android.build.gradle.LibraryExtension

0 commit comments

Comments
 (0)