Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to Gradle plugin 4.1 #168

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion FCMTutorialApp/build.gradle
Expand Up @@ -30,7 +30,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.media:media:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20'

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion notification-hubs-sample-app-java/build.gradle
Expand Up @@ -64,7 +64,7 @@ dependencies {
implementation project(':notification-hubs-sdk')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.1'
Expand Down
3 changes: 1 addition & 2 deletions notification-hubs-sample-app-kotlin/build.gradle
@@ -1,6 +1,5 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

def secretsProperties = new Properties()
def secretsPropertiesFile = rootProject.file("secrets.properties")
Expand Down Expand Up @@ -51,7 +50,7 @@ dependencies {
implementation project(':notification-hubs-sdk')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.1'
Expand Down
2 changes: 1 addition & 1 deletion notification-hubs-sample-app-legacy/build.gradle
Expand Up @@ -37,7 +37,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-core:18.0.0'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
testImplementation 'junit:junit:4.13.1'
Expand Down
8 changes: 7 additions & 1 deletion notification-hubs-sdk/build.gradle
Expand Up @@ -18,6 +18,9 @@ android {
versionName VERSION
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArguments clearPackageData: 'true'

buildConfigField 'int', 'VERSION_CODE', "${versionCode}"
buildConfigField 'String', 'VERSION_NAME', "\"${versionName}\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete these lines. We can already use gradle provided version information because of the versionCode and versionName fields above. You can see them already in use here:

private static String getUserAgent() {
String apiOrigin = "AndroidSdkV1FcmV" + BuildConfig.VERSION_NAME;
String userAgent = String.format("NOTIFICATIONHUBS/%s (api-origin=%s; os=%s; os_version=%s;)",
API_VERSION, apiOrigin, "Android", Build.VERSION.RELEASE);
return userAgent;
}

}

buildTypes {
Expand Down Expand Up @@ -183,4 +186,7 @@ artifacts {
archives androidSourcesJar
archives androidJavadocsJar
archives file : file('build/fcmRelease/' + PUBLISH_ARTIFACT_ID + '-' + version + '.jar')
}
}

// https://github.com/gradle/gradle/issues/14889
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gross 😆 Thanks for tracking this down and add a work around

tasks.register("prepareKotlinBuildScriptModel") { }
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip