241 lines
8.0 KiB
Groovy
Executable File
241 lines
8.0 KiB
Groovy
Executable File
import org.apache.tools.ant.taskdefs.condition.Os
|
||
|
||
apply plugin: 'com.android.application'
|
||
apply plugin: 'com.google.gms.google-services' // Google Services plugin
|
||
apply plugin: 'org.greenrobot.greendao'
|
||
|
||
android {
|
||
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
|
||
buildToolsVersion PROP_BUILD_TOOLS_VERSION
|
||
lintOptions {
|
||
abortOnError false
|
||
}
|
||
compileOptions {
|
||
sourceCompatibility JavaVersion.VERSION_1_8
|
||
targetCompatibility JavaVersion.VERSION_1_8
|
||
}
|
||
defaultConfig {
|
||
applicationId "com.jc.sweetheart"
|
||
minSdkVersion PROP_MIN_SDK_VERSION
|
||
targetSdkVersion PROP_TARGET_SDK_VERSION
|
||
versionCode 5
|
||
versionName "1.0.3"
|
||
multiDexEnabled true
|
||
|
||
externalNativeBuild {
|
||
ndkBuild {
|
||
if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
|
||
// skip the NDK Build step if PROP_NDK_MODE is none
|
||
targets 'cocos2djs'
|
||
arguments 'NDK_TOOLCHAIN_VERSION=clang'
|
||
|
||
def module_paths = [project.file("/Applications/CocosCreator/Creator/2.1.2/CocosCreator.app/Contents/Resources/cocos2d-x"),
|
||
project.file("/Applications/CocosCreator/Creator/2.1.2/CocosCreator.app/Contents/Resources/cocos2d-x/cocos"),
|
||
project.file("/Applications/CocosCreator/Creator/2.1.2/CocosCreator.app/Contents/Resources/cocos2d-x/external")]
|
||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||
arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
|
||
} else {
|
||
arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
|
||
}
|
||
|
||
arguments '-j' + Runtime.runtime.availableProcessors()
|
||
abiFilters.addAll(PROP_APP_ABI.split(':').collect { it as String })
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
sourceSets.main {
|
||
java.srcDir "src"
|
||
res.srcDir "res"
|
||
jniLibs.srcDir "libs"
|
||
manifest.srcFile "AndroidManifest.xml"
|
||
}
|
||
|
||
externalNativeBuild {
|
||
ndkBuild {
|
||
if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
|
||
// skip the NDK Build step if PROP_NDK_MODE is none
|
||
path "jni/Android.mk"
|
||
}
|
||
}
|
||
}
|
||
|
||
signingConfigs {
|
||
|
||
release {
|
||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||
storeFile file(RELEASE_STORE_FILE)
|
||
storePassword RELEASE_STORE_PASSWORD
|
||
keyAlias RELEASE_KEY_ALIAS
|
||
keyPassword RELEASE_KEY_PASSWORD
|
||
}
|
||
}
|
||
}
|
||
|
||
buildTypes {
|
||
release {
|
||
debuggable false
|
||
jniDebuggable false
|
||
renderscriptDebuggable false
|
||
minifyEnabled true
|
||
shrinkResources true
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
||
signingConfig signingConfigs.release
|
||
}
|
||
|
||
externalNativeBuild {
|
||
ndkBuild {
|
||
arguments 'NDK_DEBUG=0'
|
||
}
|
||
}
|
||
}
|
||
|
||
debug {
|
||
debuggable true
|
||
jniDebuggable true
|
||
renderscriptDebuggable false
|
||
externalNativeBuild {
|
||
ndkBuild {
|
||
arguments 'NDK_DEBUG=1'
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
repositories {
|
||
jcenter()
|
||
google()
|
||
mavenCentral()
|
||
maven { url 'https://maven.google.com' }
|
||
//Adcolony
|
||
maven { url "https://adcolony.bintray.com/AdColony" }
|
||
//IronSource
|
||
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
|
||
// //Mopub
|
||
// maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
|
||
//Tapjoy
|
||
maven {
|
||
name "Tapjoy's maven repo"
|
||
url "https://tapjoy.bintray.com/maven"
|
||
}
|
||
flatDir {
|
||
dirs 'libs'
|
||
}
|
||
}
|
||
}
|
||
|
||
android.applicationVariants.all { variant ->
|
||
// delete previous files first
|
||
delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
|
||
|
||
variant.mergeAssets.doLast {
|
||
def sourceDir = "${buildDir}/../../../jsb-link"
|
||
|
||
copy {
|
||
from "${sourceDir}/res"
|
||
into "${outputDir}/res"
|
||
}
|
||
|
||
copy {
|
||
from "${sourceDir}/subpackages"
|
||
into "${outputDir}/subpackages"
|
||
}
|
||
|
||
copy {
|
||
from "${sourceDir}/src"
|
||
into "${outputDir}/src"
|
||
}
|
||
|
||
copy {
|
||
from "${sourceDir}/jsb-adapter"
|
||
into "${outputDir}/jsb-adapter"
|
||
}
|
||
|
||
copy {
|
||
from "${sourceDir}/main.js"
|
||
from "${sourceDir}/project.json"
|
||
into outputDir
|
||
}
|
||
}
|
||
}
|
||
|
||
dependencies {
|
||
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
|
||
// implementation fileTree(dir: "/Applications/CocosCreator/Creator/2.1.2/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs", include: ['*.jar'])
|
||
implementation project(':libcocos2dx')
|
||
// https://mvnrepository.com/artifact/com.google.code.gson/gson
|
||
// Add the Firebase SDK for Google Analytics
|
||
implementation 'com.google.firebase:firebase-analytics:17.4.4'
|
||
implementation 'com.google.firebase:firebase-auth:19.3.2'
|
||
implementation 'com.google.code.gson:gson:2.7'
|
||
implementation 'com.android.support:multidex:1.0.3'
|
||
implementation 'org.greenrobot:greendao:3.3.0'
|
||
compile 'com.tencent.bugly:crashreport:latest.release'
|
||
compile 'com.tencent.bugly:nativecrashreport:latest.release'
|
||
|
||
//将添加到libs中的aar和jar文件引入到当前项目中
|
||
//noinspection GradleCompatible
|
||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
|
||
//4.4.0 开始支持GDPR exclude module: 'gson' 预防gson 冲突,如果没用引入gson,可以去除
|
||
implementation('com.google.android.ads.consent:consent-library:1.0.6') {
|
||
exclude module: 'gson'
|
||
}
|
||
//Admob
|
||
implementation 'com.google.android.gms:play-services-ads:18.3.0'
|
||
//IronSource
|
||
implementation 'com.ironsource.sdk:mediationsdk:6.15.0.1'
|
||
//Unity Ads
|
||
// implementation(name: 'unity-ads', ext: 'aar')
|
||
//Facebook
|
||
// implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||
// implementation 'com.facebook.android:audience-network-sdk:5.7.1'
|
||
//MoPub
|
||
// For banners
|
||
// implementation ('com.mopub:mopub-sdk-banner:5.8.0') {
|
||
// transitive = true
|
||
// }
|
||
// For interstitials
|
||
// implementation ('com.mopub:mopub-sdk-interstitial:5.8.0') {
|
||
// transitive = true
|
||
// }
|
||
// For rewarded videos. This will automatically also include interstitials
|
||
// implementation ('com.mopub:mopub-sdk-rewardedvideo:5.8.0') {
|
||
// transitive = true
|
||
// }
|
||
// For native static (images).
|
||
// implementation ('com.mopub:mopub-sdk-native-static:5.8.0') {
|
||
// transitive = true
|
||
// }
|
||
// For native video. This will automatically also include native static
|
||
// implementation ('com.mopub:mopub-sdk-native-video:5.8.0') {
|
||
// transitive = true
|
||
// }
|
||
//AppLovin
|
||
// implementation 'com.applovin:applovin-sdk:9.11.4'
|
||
|
||
|
||
//Tapjoy
|
||
// implementation 'com.tapjoy:tapjoy-android-sdk:12.4.2@aar'
|
||
//Adcolony
|
||
// implementation 'com.adcolony:sdk:4.1.2'
|
||
//Vungle
|
||
// implementation 'com.vungle:publisher-sdk-android:6.7.0'
|
||
// implementation 'com.google.android.gms:play-services-basement:17.3.0'
|
||
// implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
|
||
// 4.2.X开始支持国内渠道
|
||
//腾讯优量汇
|
||
// implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
|
||
|
||
}
|
||
|
||
greendao {
|
||
schemaVersion 1 //数据库版本号
|
||
daoPackage 'com.jc.jcfw.db'// 设置DaoMaster、DaoSession、Dao 包名
|
||
// targetGenDir 'src'//设置DaoMaster、DaoSession、Dao目录
|
||
}
|
||
|
||
|