This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
81 lines (65 loc) · 2.26 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
apply plugin: 'com.android.application'
import java.text.DateFormat
import java.text.SimpleDateFormat
def getDateTimestamp() {
DateFormat df = new SimpleDateFormat("YYYY-MM-dd @ HH:mm:ss a");
return new String(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
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.maxieds.MCTLibraryDemo"
minSdkVersion 25
targetSdkVersion 28
versionCode 20
versionName "1.2.0"
buildConfigField "String", "BUILD_TIMESTAMP", "\"" + getDateTimestamp() + "\""
buildConfigField "String", "GIT_COMMIT_HASH", "\"" + getGitCommitHash() + "\""
buildConfigField "String", "GIT_COMMIT_DATE", "\"" + getGitCommitDate() + "\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/androidx*'
exclude 'META-INF/android*'
}
}
}
repositories {
jcenter()
google()
maven { url 'https://jitpack.io' }
dependencies {
classpath 'com.android.tools.build:gradle:4.10.1'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.github.maxieds:MifareClassicToolLibrary:1.1.9'
implementation 'com.nononsenseapps:filepicker:4.1.0'
classpath 'com.android.tools.build:gradle:4.10.1'
}