From caff3422a8280e94cdd18258c7cf2caacb521d6a Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Tue, 24 Oct 2017 19:06:53 -0400 Subject: [PATCH 1/8] Updated the android-maven plugin and required Android Studio 3.0 --- build.gradle | 5 +++-- library/build.gradle | 14 ++++++++------ settings.gradle | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 3e00215..e358eed 100755 --- a/build.gradle +++ b/build.gradle @@ -6,10 +6,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.android.tools.build:gradle:3.0.0-rc2' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' } } diff --git a/library/build.gradle b/library/build.gradle index 2b4ce39..59ed886 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -16,8 +16,6 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -group = 'com.github.Pattonville-Robotics' - android { compileSdkVersion 26 @@ -36,8 +34,8 @@ android { minSdkVersion 19 targetSdkVersion 26 - versionName '3.4.1' - versionCode 5 + versionName '3.4.2' + versionCode 6 } // Advanced user code might just want to use Vuforia directly, so we set up the libs as needed @@ -67,6 +65,10 @@ android { } } +group = 'com.github.Pattonville-Robotics' +version = android.defaultConfig.versionName +project.archivesBaseName = 'Common-Code' + dependencies { compile 'org.first.ftc:inspection:3.4' compile 'org.first.ftc:blocks:3.4' @@ -98,7 +100,7 @@ task sourcesJar(type: Jar) { } task javadoc(type: Javadoc) { - failOnError false + failOnError false source = android.sourceSets.main.java.sourceFiles classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) classpath += configurations.compile @@ -113,4 +115,4 @@ task javadocJar(type: Jar, dependsOn: javadoc) { artifacts { archives sourcesJar archives javadocJar -} +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index d8f14a1..3732968 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':library' +include ':library' \ No newline at end of file From b91c583448b12b152e4942e1396b8192512a2c04 Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Tue, 24 Oct 2017 21:06:40 -0400 Subject: [PATCH 2/8] Added .jar generation for JitPack --- library/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/build.gradle b/library/build.gradle index 59ed886..389384f 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -115,4 +115,12 @@ task javadocJar(type: Jar, dependsOn: javadoc) { artifacts { archives sourcesJar archives javadocJar +} + +android.libraryVariants.all { variant -> + def name = variant.buildType.name + def task = project.tasks.create "jar${name.capitalize()}", Jar + task.dependsOn variant.javaCompiler + task.from variant.javaCompiler.destinationDir + artifacts.add 'archives', task } \ No newline at end of file From ae21abf4d79882e388f29fe635087d039380edae Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Tue, 24 Oct 2017 21:38:28 -0400 Subject: [PATCH 3/8] Made Android dependencies compileOnly --- library/build.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 389384f..7726090 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -70,13 +70,13 @@ version = android.defaultConfig.versionName project.archivesBaseName = 'Common-Code' dependencies { - compile 'org.first.ftc:inspection:3.4' - compile 'org.first.ftc:blocks:3.4' - compile 'org.first.ftc:robotcore:3.4' - compile 'org.first.ftc:hardware:3.4' - compile 'org.first.ftc:ftc-common:3.4' - compile 'org.first.ftc:analytics:3.4' - compile 'org.first.ftc:wireless-p2p:3.4' + compileOnly 'org.first.ftc:inspection:3.4' + compileOnly 'org.first.ftc:blocks:3.4' + compileOnly 'org.first.ftc:robotcore:3.4' + compileOnly 'org.first.ftc:hardware:3.4' + compileOnly 'org.first.ftc:ftc-common:3.4' + compileOnly 'org.first.ftc:analytics:3.4' + compileOnly 'org.first.ftc:wireless-p2p:3.4' // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' From 30f72b367bc60be3282afb4ac8c025dc43a5523f Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Tue, 24 Oct 2017 23:20:27 -0400 Subject: [PATCH 4/8] Added ProGuard minifying and replaced compile with implementation --- library/build.gradle | 18 ++++++++++++++---- library/proguard-rules.pro | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 library/proguard-rules.pro diff --git a/library/build.gradle b/library/build.gradle index 7726090..5d969a0 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -45,12 +45,18 @@ android { ndk { abiFilters "armeabi-v7a" } + + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { debuggable true ndk { abiFilters "armeabi-v7a" } + + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -59,6 +65,10 @@ android { targetCompatibility JavaVersion.VERSION_1_7 } + lintOptions { + abortOnError false //TODO actually ignore the exact lint checks that error + } + sourceSets.main { jni.srcDirs = [] jniLibs.srcDir "../libs" @@ -79,16 +89,16 @@ dependencies { compileOnly 'org.first.ftc:wireless-p2p:3.4' // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 - compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' + implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' // https://mvnrepository.com/artifact/com.annimon/stream - compile group: 'com.annimon', name: 'stream', version: '1.1.8' + implementation group: 'com.annimon', name: 'stream', version: '1.1.8' // https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 - compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' + implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' // https://mvnrepository.com/artifact/com.google.guava/guava - compile group: 'com.google.guava', name: 'guava', version: '23.2-android' + implementation group: 'com.google.guava', name: 'guava', version: '23.2-android' } //For JitPack diff --git a/library/proguard-rules.pro b/library/proguard-rules.pro new file mode 100644 index 0000000..e8e2a10 --- /dev/null +++ b/library/proguard-rules.pro @@ -0,0 +1,7 @@ +-verbose +-dontobfuscate + +#Common Code +-keep,includedescriptorclasses class org.pattonvillerobotics.commoncode.** { + *; +} \ No newline at end of file From fee52bf1c020211bc5d3a6fde5837f6c2bfa244f Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Tue, 24 Oct 2017 23:29:04 -0400 Subject: [PATCH 5/8] Changed compileOnly to provided for correct Android support --- library/build.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 5d969a0..2faf2f7 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -80,13 +80,13 @@ version = android.defaultConfig.versionName project.archivesBaseName = 'Common-Code' dependencies { - compileOnly 'org.first.ftc:inspection:3.4' - compileOnly 'org.first.ftc:blocks:3.4' - compileOnly 'org.first.ftc:robotcore:3.4' - compileOnly 'org.first.ftc:hardware:3.4' - compileOnly 'org.first.ftc:ftc-common:3.4' - compileOnly 'org.first.ftc:analytics:3.4' - compileOnly 'org.first.ftc:wireless-p2p:3.4' + provided 'org.first.ftc:inspection:3.4' + provided 'org.first.ftc:blocks:3.4' + provided 'org.first.ftc:robotcore:3.4' + provided 'org.first.ftc:hardware:3.4' + provided 'org.first.ftc:ftc-common:3.4' + provided 'org.first.ftc:analytics:3.4' + provided 'org.first.ftc:wireless-p2p:3.4' // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' From 199ac91c3d73bc2692ecf4d7a65caebbbd771259 Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Tue, 24 Oct 2017 23:36:25 -0400 Subject: [PATCH 6/8] Removed "blocks" dependency to prevent dex merge errors in team projects --- library/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/build.gradle b/library/build.gradle index 2faf2f7..10d6ba0 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -81,7 +81,7 @@ project.archivesBaseName = 'Common-Code' dependencies { provided 'org.first.ftc:inspection:3.4' - provided 'org.first.ftc:blocks:3.4' + //provided 'org.first.ftc:blocks:3.4' provided 'org.first.ftc:robotcore:3.4' provided 'org.first.ftc:hardware:3.4' provided 'org.first.ftc:ftc-common:3.4' From 1be34978bddbd05f31a934a24467375e676b6516 Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Wed, 25 Oct 2017 15:59:11 -0400 Subject: [PATCH 7/8] Disabled ProGuard and changed provided dependencies to implementation --- library/build.gradle | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 10d6ba0..51187f7 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -46,8 +46,8 @@ android { abiFilters "armeabi-v7a" } - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + //minifyEnabled true + //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { debuggable true @@ -55,8 +55,8 @@ android { abiFilters "armeabi-v7a" } - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + //minifyEnabled true + //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -80,13 +80,13 @@ version = android.defaultConfig.versionName project.archivesBaseName = 'Common-Code' dependencies { - provided 'org.first.ftc:inspection:3.4' - //provided 'org.first.ftc:blocks:3.4' - provided 'org.first.ftc:robotcore:3.4' - provided 'org.first.ftc:hardware:3.4' - provided 'org.first.ftc:ftc-common:3.4' - provided 'org.first.ftc:analytics:3.4' - provided 'org.first.ftc:wireless-p2p:3.4' + implementation 'org.first.ftc:inspection:3.4' + implementation 'org.first.ftc:blocks:3.4' + implementation 'org.first.ftc:robotcore:3.4' + implementation 'org.first.ftc:hardware:3.4' + implementation 'org.first.ftc:ftc-common:3.4' + implementation 'org.first.ftc:analytics:3.4' + implementation 'org.first.ftc:wireless-p2p:3.4' // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' From 7687a3039d9e9d7f116927377dd205d5a0c5d4dd Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Fri, 27 Oct 2017 15:52:13 -0500 Subject: [PATCH 8/8] Extracted version number and updated to build tools 3.0.0 --- build.gradle | 6 ++++-- library/build.gradle | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index e358eed..aa9fa22 100755 --- a/build.gradle +++ b/build.gradle @@ -4,12 +4,14 @@ * It is extraordinarily rare that you will ever need to edit this file. */ buildscript { + ext.ftc_version = '3.4' + repositories { - jcenter() google() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0-rc2' + classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' } } diff --git a/library/build.gradle b/library/build.gradle index 51187f7..3b36e58 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -17,9 +17,7 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' android { - compileSdkVersion 26 - buildToolsVersion '26.0.2' signingConfigs { debug { @@ -34,7 +32,7 @@ android { minSdkVersion 19 targetSdkVersion 26 - versionName '3.4.2' + versionName "$ftc_version.2" versionCode 6 } @@ -80,13 +78,13 @@ version = android.defaultConfig.versionName project.archivesBaseName = 'Common-Code' dependencies { - implementation 'org.first.ftc:inspection:3.4' - implementation 'org.first.ftc:blocks:3.4' - implementation 'org.first.ftc:robotcore:3.4' - implementation 'org.first.ftc:hardware:3.4' - implementation 'org.first.ftc:ftc-common:3.4' - implementation 'org.first.ftc:analytics:3.4' - implementation 'org.first.ftc:wireless-p2p:3.4' + implementation "org.first.ftc:inspection:$ftc_version" + implementation "org.first.ftc:blocks:$ftc_version" + implementation "org.first.ftc:robotcore:$ftc_version" + implementation "org.first.ftc:hardware:$ftc_version" + implementation "org.first.ftc:ftc-common:$ftc_version" + implementation "org.first.ftc:analytics:$ftc_version" + implementation "org.first.ftc:wireless-p2p:$ftc_version" // https://mvnrepository.com/artifact/org.apache.commons/commons-math3 implementation group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' @@ -126,11 +124,12 @@ artifacts { archives sourcesJar archives javadocJar } - +/* android.libraryVariants.all { variant -> def name = variant.buildType.name def task = project.tasks.create "jar${name.capitalize()}", Jar task.dependsOn variant.javaCompiler task.from variant.javaCompiler.destinationDir artifacts.add 'archives', task -} \ No newline at end of file +} +*/ \ No newline at end of file