Skip to content

Commit

Permalink
Upgrade AGP, Gradle, language dependencies
Browse files Browse the repository at this point in the history
- Upgrades
   - Gradle distribution 7.5
   - Gradle 7.3.1
   - Java 1.8
   - Kotlin 1.6.2
   - jacoco 0.8.8
- Expand .gitignore
- Restructure plugin declarations
- Fix functional test configuration (dex, androidx.test:core))
  • Loading branch information
prudrabhat committed Nov 8, 2022
1 parent 7338285 commit 5701a42
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 58 deletions.
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,21 @@ ci/
**/.idea/

# Secrets
**/*/values/secrets.xml
**/*/values/secrets.xml

# Local configuration file (sdk path, etc)
local.properties

# Android Studio Navigation editor temp files
.navigation/

# Coverage tools
jacoco.exec

# Application files
*.apk
*.aar
*.aab

# Dex files for ART/Dalvik VM
*.dex
24 changes: 13 additions & 11 deletions code/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "com.diffplug.spotless"
plugins {
id 'com.android.application'
id 'com.diffplug.spotless'
id 'org.jetbrains.kotlin.android'
}

spotless {
kotlin {
Expand All @@ -12,14 +13,14 @@ spotless {
}

android {
compileSdkVersion 31
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
applicationId "com.adobe.marketing.edge.identity.app"
minSdkVersion 19
targetSdkVersion 31
versionCode 1
versionName "1.0"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName project.property('moduleVersion') as String ?: "1.0"
multiDexEnabled = true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -35,14 +36,15 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = rootProject.ext.kotlinJvmTarget
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Expand Down
66 changes: 28 additions & 38 deletions code/build.gradle
Original file line number Diff line number Diff line change
@@ -1,53 +1,43 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.5.0'
}
repositories {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.12.5"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

apply plugin: 'maven-publish'
}

task clean(type: Delete) {
delete rootProject.buildDir
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.diffplug.gradle.spotless' version '6.11.0' apply false
id 'org.jetbrains.kotlin.android' version "1.6.21" apply false
}

ext {
// android config
minSdkVersion = 19
targetSdkVersion = 29
compileSdkVersion = 29
targetSdkVersion = 33
compileSdkVersion = 33
versionCode = 1

// java config
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

// dependencies
// kotlin config
kotlinVersion = "1.6.21"
kotlinJvmTarget = "1.8"

// test dependencies
junitVersion = "1.1.2"
mockitoCoreVersion = "2.28.2"
buildToolsVersion = "29.0.3"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
jacocoVersion = "0.8.5"

// build tools
buildToolsVersion = "29.0.3"

// spotless
prettierVersion = "2.7.1"
prettierPluginJavaVersion = "1.6.2"

// jacoco
jacocoVersion = "0.8.8"
}

task clean(type: Delete) {
delete rootProject.buildDir
}
16 changes: 10 additions & 6 deletions code/edgeidentity/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
apply plugin: 'com.android.library'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "com.diffplug.spotless"
plugins {
id 'com.android.library'
id 'jacoco'
id 'maven-publish'
id 'signing'
id 'com.diffplug.spotless'
}

jacoco {
toolVersion = rootProject.ext.jacocoVersion
Expand Down Expand Up @@ -31,6 +33,7 @@ android {

testInstrumentationRunner rootProject.ext.testInstrumentationRunner
consumerProguardFiles "consumer-rules.pro"
multiDexEnabled true
}

flavorDimensions "target"
Expand Down Expand Up @@ -218,7 +221,7 @@ task platformUnitTestJacocoReport(type: JacocoReport, dependsOn: "testPhoneDebug
additionalClassDirs.setFrom files([debugTree])
additionalSourceDirs.setFrom files(android.sourceSets.main.java.sourceFiles)
sourceDirectories.setFrom files(android.sourceSets.phone.java.sourceFiles)
executionData "$buildDir/jacoco/testPhoneDebugUnitTest.exec"
executionData "$buildDir/outputs/unit_test_code_coverage/phoneDebugUnitTest/testPhoneDebugUnitTest.exec"

reports {
xml.enabled true
Expand Down Expand Up @@ -259,6 +262,7 @@ dependencies {
testImplementation 'org.powermock:powermock-module-junit4:2.0.0'
testImplementation 'org.json:json:20180813'

androidTestImplementation "androidx.test:core:1.4.0"
androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.junitVersion}"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// Using older version of PowerMock as it supports minimum Android API < 26
Expand Down
4 changes: 2 additions & 2 deletions code/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 18 11:50:52 PDT 2022
#Mon Nov 07 08:48:57 PST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
17 changes: 17 additions & 0 deletions code/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}

include ':app'
include ':edgeidentity'
rootProject.name = "edgeidentity-sdk"

0 comments on commit 5701a42

Please sign in to comment.