Unity 2018.3 버전에서 사용
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
repositories {
if (GradleVersion.current() >= GradleVersion.version("4.2")) {
jcenter()
google()
} else {
jcenter()
}
maven { url "https://maven.google.com/"}
}
dependencies {
// use newer version of the plugin for newer unity/gradle versions
if (GradleVersion.current() < GradleVersion.version("4.0")) {
classpath 'com.android.tools.build:gradle:2.1.0'
} else if (GradleVersion.current() < GradleVersion.version("4.2")) { // Unity 2018.1 : Gradle version 4.0.1
classpath 'com.android.tools.build:gradle:2.3.3'
} else { // Unity 2018.2 : Gradle version 4.2.1
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
}
allprojects {
repositories {
if (GradleVersion.current() >= GradleVersion.version("4.2")) {
jcenter()
google()
} else {
jcenter()
}
maven { url 'https://maven.google.com'}
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.application'
dependencies {
compile 'com.android.support:multidex:1.0.1'
if (GradleVersion.current() >= GradleVersion.version("4.2")) {
implementation fileTree(dir: 'libs', include: ['*.jar'])
} else {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
**DEPS**
}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
if (GradleVersion.current() < GradleVersion.version("4.2")) {
// fix complaint that 3rd party libraries have the same package name
enforceUniquePackageName false
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
applicationId '**APPLICATIONID**'
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
// Enabling multidex support.
multiDexEnabled true
if (GradleVersion.current() >= GradleVersion.version("4.0")) {
ndk {
abiFilters **ABIFILTERS**
}
}
}
dexOptions {
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress '.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**
}
**SIGN**
buildTypes {
debug {
minifyEnabled **MINIFY_DEBUG**
if (GradleVersion.current() >= GradleVersion.version("4.2")) {// > Build-in class shrinker and multidex are not supported yet.
useProguard **PROGUARD_DEBUG**
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
jniDebuggable true
}
release {
minifyEnabled **MINIFY_RELEASE**
if (GradleVersion.current() >= GradleVersion.version("4.2")) {// > Build-in class shrinker and multidex are not supported yet.
useProguard **PROGUARD_RELEASE**
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD**
**SIGNCONFIG**
}
}
**PACKAGING_OPTIONS**
}
**SOURCE_BUILD_SETUP**