Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
New Gradle files
Browse files Browse the repository at this point in the history
  • Loading branch information
maxieds committed Apr 18, 2019
1 parent 368d616 commit faf8eba
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 8 deletions.
27 changes: 23 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,34 @@ 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
defaultConfig {
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 {
Expand All @@ -34,7 +51,7 @@ android {
crunchPngs false
}
}
buildToolsVersion '28.0.2'
buildToolsVersion '28.0.3'

flavorDimensions "mode"
def configBuildTimeStamp = getDateTimestamp()
Expand All @@ -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"
Expand All @@ -69,6 +87,7 @@ android {
dimension "mode"
manifestPlaceholders = [
appIcon : "@drawable/chameleonicon64_paid",
appRoundIcon : "@drawable/chameleonicon64_paid",
appTheme: "@style/AppThemeGreen",
appDebug: "false",
installLocation: "auto"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions mifareclassictoollibrary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
34 changes: 34 additions & 0 deletions mifareclassictoollibrary/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
21 changes: 21 additions & 0 deletions mifareclassictoollibrary/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@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());
}
}
2 changes: 2 additions & 0 deletions mifareclassictoollibrary/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maxieds.mifareclassictoollibrary" />
3 changes: 3 additions & 0 deletions mifareclassictoollibrary/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">MifareClassicToolLibrary</string>
</resources>
Original file line number Diff line number Diff line change
@@ -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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app'

0 comments on commit faf8eba

Please sign in to comment.