-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
136 lines (109 loc) · 5.43 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
// Declaration app name
def nameApp = "Admob Helper"
// Declaration apk / aab name
def nameAPK = "admob-helper"
def versionPropsFile = file('version.properties')
Properties versionProps = new Properties()
if (versionPropsFile.canRead()) {
versionProps.load(new FileInputStream(versionPropsFile))
} else {
versionProps['VERSION_CODE'] = '0'
}
def code = versionProps['VERSION_CODE'].toInteger()
versionProps['VERSION_CODE'] = code.toString()
versionProps.store(versionPropsFile.newWriter(), null)
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.frogobox.admobhelper"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// Declaration apps name debug mode
def debugAttribute = " Development"
def nameAppDebug = nameApp + debugAttribute
// Declaration admob id for debug
def debugAdmobPublisherId = "ca-app-pub-3940256099942544~3347511713"
def debugAdmobBanner = "ca-app-pub-3940256099942544/6300978111"
def debugAdmobInterstitial = "ca-app-pub-3940256099942544/1033173712"
def debugAdmobInterstitialVideo = "ca-app-pub-3940256099942544/8691691433"
def debugAdmobRewardedVideo = "ca-app-pub-3940256099942544/5224354917"
def debugAdmobNativeAdvanced = "ca-app-pub-3940256099942544/2247696110"
def debugAdmobNativeAdvancedVideo = "ca-app-pub-3940256099942544/1044960115"
// Naming APK // AAB
setProperty("archivesBaseName", nameAPK + versionName + "#" + code + "-"
+ new Date().format('ddMMyy'))
resConfigs "en", "id"
vectorDrawables.useSupportLibrary = true
// Inject app name for debug
resValue "string", "app_name", nameAppDebug
// Inject admob id for debug
resValue "string", "admob_publisher_id", debugAdmobPublisherId
resValue "string", "admob_banner", debugAdmobBanner
resValue "string", "admob_interstitial", debugAdmobInterstitial
resValue "string", "admob_interstitial_video", debugAdmobInterstitialVideo
resValue "string", "admob_rewarded_video", debugAdmobRewardedVideo
resValue "string", "admob_native_advanced", debugAdmobNativeAdvanced
resValue "string", "admob_native_advanced_video", debugAdmobNativeAdvancedVideo
}
signingConfigs {
release {
// You need to specify either an absolute path or include the
// keystore file in the same directory as the build.gradle file.
// [PROJECT FOLDER NAME/app/[COPY YOUT KEY STORE] .jks in here
storeFile file("key.jks")
storePassword "key"
keyAlias "key"
keyPassword "key"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// Generated Signed APK / AAB
signingConfig signingConfigs.release
// Declaration admob id for release
def releaseAdmobPublisherId = "ca-app-pub-3940256099942544~3347511713"
def releaseAdmobBanner = "ca-app-pub-3940256099942544/6300978111"
def releaseAdmobInterstitial = "ca-app-pub-3940256099942544/1033173712"
def releaseAdmobInterstitialVideo = "ca-app-pub-3940256099942544/8691691433"
def releaseAdmobRewardedVideo = "ca-app-pub-3940256099942544/5224354917"
def releaseAdmobNativeAdvanced = "ca-app-pub-3940256099942544/2247696110"
def releaseAdmobNativeAdvancedVideo = "ca-app-pub-3940256099942544/1044960115"
// Inject app name for release
resValue "string", "app_name", nameApp
// Inject admob id for release
resValue "string", "admob_publisher_id", releaseAdmobPublisherId
resValue "string", "admob_banner", releaseAdmobBanner
resValue "string", "admob_interstitial", releaseAdmobInterstitial
resValue "string", "admob_interstitial_video", releaseAdmobInterstitialVideo
resValue "string", "admob_rewarded_video", releaseAdmobRewardedVideo
resValue "string", "admob_native_advanced", releaseAdmobNativeAdvanced
resValue "string", "admob_native_advanced_video", releaseAdmobNativeAdvancedVideo
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation project(':frogoadmobhelper')
implementation project(':nativetemplates')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.android.material:material:1.2.0-alpha04'
// lib google ads
implementation 'com.google.android.gms:play-services-ads:18.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}