From faf8eba48e38113a20266276de53c27ed6ce8197 Mon Sep 17 00:00:00 2001 From: maxieds Date: Thu, 18 Apr 2019 04:30:39 -0400 Subject: [PATCH] New Gradle files --- app/build.gradle | 27 ++++++++++++--- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +-- mifareclassictoollibrary/.gitignore | 1 + mifareclassictoollibrary/build.gradle | 34 +++++++++++++++++++ mifareclassictoollibrary/proguard-rules.pro | 21 ++++++++++++ .../ExampleInstrumentedTest.java | 26 ++++++++++++++ .../src/main/AndroidManifest.xml | 2 ++ .../src/main/res/values/strings.xml | 3 ++ .../ExampleUnitTest.java | 17 ++++++++++ settings.gradle | 2 +- 11 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 mifareclassictoollibrary/.gitignore create mode 100644 mifareclassictoollibrary/build.gradle create mode 100644 mifareclassictoollibrary/proguard-rules.pro create mode 100644 mifareclassictoollibrary/src/androidTest/java/com/maxieds/mifareclassictoollibrary/ExampleInstrumentedTest.java create mode 100644 mifareclassictoollibrary/src/main/AndroidManifest.xml create mode 100644 mifareclassictoollibrary/src/main/res/values/strings.xml create mode 100644 mifareclassictoollibrary/src/test/java/com/maxieds/mifareclassictoollibrary/ExampleUnitTest.java diff --git a/app/build.gradle b/app/build.gradle index 2a2b072..686300f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,6 +9,20 @@ def getDateTimestamp() { return new String("BuildTime=" + df.format(new Date()).toString()); } +def getShellCommandOutput(String shellCmd) { + def cmdResult = ['bash', '-c', shellCmd].execute(); + cmdResult.waitFor(); + return cmdResult.text[0..-2]; +} + +def getGitCommitHash() { + return getShellCommandOutput("git show | head -n 1 | sed -e \"s/commit //\" | cut -c-12"); +} + +def getGitCommitDate() { + return getShellCommandOutput("git show | grep Date: | head -n 1 | sed -e \"s/Date:[ ]*//\""); +} + android { compileSdkVersion 28 @@ -16,10 +30,13 @@ android { applicationId "com.maxieds.chameleonminilivedebugger" minSdkVersion 26 targetSdkVersion 28 - versionCode 54 - versionName "0.5.4" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + versionCode 57 + versionName "0.5.7" + //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true + + buildConfigField "String", "GIT_COMMIT_HASH", "\"" + getGitCommitHash() + "\"" + buildConfigField "String", "GIT_COMMIT_DATE", "\"" + getGitCommitDate() + "\"" } buildTypes { release { @@ -34,7 +51,7 @@ android { crunchPngs false } } - buildToolsVersion '28.0.2' + buildToolsVersion '28.0.3' flavorDimensions "mode" def configBuildTimeStamp = getDateTimestamp() @@ -54,6 +71,7 @@ android { resConfigs "en", "en_US", "en_UK", "de" manifestPlaceholders = [ appIcon : "@drawable/chameleonicon_about64", + appRoundIcon : "@drawable/chameleonicon_about64_roundicon", appTheme: "@style/AppThemeGreen", appDebug: "false", installLocation: "internalOnly" @@ -69,6 +87,7 @@ android { dimension "mode" manifestPlaceholders = [ appIcon : "@drawable/chameleonicon64_paid", + appRoundIcon : "@drawable/chameleonicon64_paid", appTheme: "@style/AppThemeGreen", appDebug: "false", installLocation: "auto" diff --git a/build.gradle b/build.gradle index b1f0924..3438f1d 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.0' + classpath 'com.android.tools.build:gradle:3.3.2' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2915658..b011a48 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Sep 26 18:41:06 EDT 2018 +#Fri Apr 12 11:00:22 EDT 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/mifareclassictoollibrary/.gitignore b/mifareclassictoollibrary/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/mifareclassictoollibrary/.gitignore @@ -0,0 +1 @@ +/build diff --git a/mifareclassictoollibrary/build.gradle b/mifareclassictoollibrary/build.gradle new file mode 100644 index 0000000..f602356 --- /dev/null +++ b/mifareclassictoollibrary/build.gradle @@ -0,0 +1,34 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + + + + defaultConfig { + minSdkVersion 26 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'com.android.support:appcompat-v7:28.0.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/mifareclassictoollibrary/proguard-rules.pro b/mifareclassictoollibrary/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/mifareclassictoollibrary/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/mifareclassictoollibrary/src/androidTest/java/com/maxieds/mifareclassictoollibrary/ExampleInstrumentedTest.java b/mifareclassictoollibrary/src/androidTest/java/com/maxieds/mifareclassictoollibrary/ExampleInstrumentedTest.java new file mode 100644 index 0000000..34fa052 --- /dev/null +++ b/mifareclassictoollibrary/src/androidTest/java/com/maxieds/mifareclassictoollibrary/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.maxieds.mifareclassictoollibrary; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.maxieds.mifareclassictoollibrary.test", appContext.getPackageName()); + } +} diff --git a/mifareclassictoollibrary/src/main/AndroidManifest.xml b/mifareclassictoollibrary/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e4b060a --- /dev/null +++ b/mifareclassictoollibrary/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/mifareclassictoollibrary/src/main/res/values/strings.xml b/mifareclassictoollibrary/src/main/res/values/strings.xml new file mode 100644 index 0000000..ca3d0ee --- /dev/null +++ b/mifareclassictoollibrary/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + MifareClassicToolLibrary + diff --git a/mifareclassictoollibrary/src/test/java/com/maxieds/mifareclassictoollibrary/ExampleUnitTest.java b/mifareclassictoollibrary/src/test/java/com/maxieds/mifareclassictoollibrary/ExampleUnitTest.java new file mode 100644 index 0000000..b05cb64 --- /dev/null +++ b/mifareclassictoollibrary/src/test/java/com/maxieds/mifareclassictoollibrary/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.maxieds.mifareclassictoollibrary; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e7b4def..9d495b3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app' +include ':app' \ No newline at end of file