diff --git a/.gitignore b/.gitignore index 878c2cd..effdd7c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ .externalNativeBuild .cxx local.properties +.java-version diff --git a/README.md b/README.md index 58c6951..f757c63 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ class and in the Android manifest file. ## Requirements * Gradle-based Android project -* Android Gradle plugin 4.2.x +* Android Gradle plugin 7.0.0 ## Installation @@ -24,7 +24,7 @@ Groovy: ```groovy buildscript { dependencies { - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0" + classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0" } } ``` @@ -33,7 +33,7 @@ Kotlin: ```kotlin buildscript { dependencies { - classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0") + classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0") } } ``` diff --git a/build.gradle b/build.gradle index 2d93452..5b001ee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,22 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.4.32" + ext.kotlin_version = "1.5.20" repositories { mavenLocal() google() mavenCentral() + maven { + url = uri("https://maven.pkg.github.com/google/secrets-gradle-plugin") + credentials { + username = project.findProperty("ghGprUser") ?: System.getenv("ghGprUser") + password = project.findProperty("ghGprToken") ?: System.getenv("ghGprToken") + } + } } dependencies { - classpath "com.android.tools.build:gradle:4.2.1" + classpath "com.android.tools.build:gradle:7.0.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:1.3.0" + classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle.properties b/gradle.properties index 3d428c9..69c420d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,4 +21,7 @@ android.enableJetifier=true kotlin.code.style=official gradle.publish.key= -gradle.publish.secret= \ No newline at end of file +gradle.publish.secret= + +ghGprUser= +ghGprToken= diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a075ce2..5ab98ef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Nov 26 22:14:52 PST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip diff --git a/secrets-gradle-plugin/build.gradle.kts b/secrets-gradle-plugin/build.gradle.kts index c0245f9..c860f3b 100644 --- a/secrets-gradle-plugin/build.gradle.kts +++ b/secrets-gradle-plugin/build.gradle.kts @@ -15,7 +15,6 @@ plugins { `java-gradle-plugin` `maven-publish` - id("com.gradle.plugin-publish") version "0.12.0" id("kotlin") } @@ -25,9 +24,9 @@ java { } dependencies { - compileOnly("com.android.tools.build:gradle:4.2.1") + compileOnly("com.android.tools.build:gradle:7.0.0") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10") - testImplementation("com.android.tools.build:gradle:4.2.1") + testImplementation("com.android.tools.build:gradle:7.0.0-beta04") testImplementation("junit:junit:4.13.1") testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") } @@ -43,20 +42,6 @@ gradlePlugin { } } -pluginBundle { - website = PluginInfo.url - vcsUrl = PluginInfo.url - description = PluginInfo.description - version = PluginInfo.version - - (plugins) { - PluginInfo.name { - displayName = PluginInfo.displayName - tags = listOf("kotlin", "android") - } - } -} - publishing { publications { create("mavenPub") { @@ -98,18 +83,27 @@ publishing { } } repositories { - maven(url = "build/repository") + maven { + name = "localPluginRepository" + url = uri("build/repository") + } mavenLocal() } } +project(":secrets-gradle-plugin") { + version = PluginInfo.version +} + object PluginInfo { - const val artifactId = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin.gradle.plugin" + const val artifactId = + "com.google.android.libraries.mapsplatform.secrets-gradle-plugin.gradle.plugin" const val description = "A Gradle plugin for providing secrets securely to an Android project." const val displayName = "Secrets Gradle Plugin for Android" const val group = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin" - const val implementationClass = "com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPlugin" + const val implementationClass = + "com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPlugin" const val name = "secretsGradlePlugin" const val url = "https://github.com/google/secrets-gradle-plugin" - const val version = "1.3.0" -} + const val version = "2.0.0" +} \ No newline at end of file diff --git a/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt b/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt index c667b17..567a48e 100644 --- a/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt +++ b/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt @@ -16,9 +16,9 @@ package com.google.android.libraries.mapsplatform.secrets_gradle_plugin -import com.android.build.api.extension.ApplicationAndroidComponentsExtension -import com.android.build.api.extension.LibraryAndroidComponentsExtension +import com.android.build.api.variant.ApplicationAndroidComponentsExtension import com.android.build.api.variant.BuildConfigField +import com.android.build.api.variant.LibraryAndroidComponentsExtension import com.android.build.api.variant.Variant import com.android.build.gradle.AppExtension import com.android.build.gradle.LibraryExtension