buildscript {
repositories {
maven{ url 'https://maven.aliyun.com/respository/google'}
maven{ url 'https://maven.aliyun.com/respository/jcenter'}
// maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
google()
// jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
apply plugin: 'android'
dependencies {
compileOnly files('xxxservice/telephony/classes.jar')
compileOnly files('xxxservice/xxxservice.jar')
implementation fileTree(dir: 'libs', include: '*.jar')
}
android {
signingConfigs {
WeiXinconfig {
storeFile file('sign/weixin.keystore')
storePassword 'xxxx'
keyAlias = 'androidxxxkey'
keyPassword 'xxx'
}
rk3288config {
storeFile file('sign/rk3288.keystore')
storePassword 'xxx'
keyAlias = 'androidxxkey'
keyPassword 'xxx'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//signingConfig signingConfigs.rk3288config
signingConfig signingConfigs.WeiXinconfig
}
debug {
signingConfig signingConfigs.rk3288config
}
}
compileSdkVersion 26
buildToolsVersion "28.0.3"
defaultConfig {
targetSdkVersion 26
minSdkVersion 22
applicationId = 'com.xxxxx.xxxxx'
versionCode = 1.0
versionName = 'V2.92.L818.xxxx'
versionNameSuffix = '-AS'
applicationIdSuffix = ''
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
useLibrary 'org.apache.http.legacy'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jni.srcDirs = []
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
//instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
allprojects {
repositories {
maven{ url 'https://maven.aliyun.com/respository/google'}
maven{ url 'https://maven.aliyun.com/respository/gradle-plugin'}
maven{ url 'https://maven.aliyun.com/respository/central'}
maven { url 'https://maven.aliyun.com/repository/central' }
google()
// jcenter()
mavenCentral()
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xbootclasspath/p:xxxservice/telephony/classes.jar') // libs/framework.jar为项目相对目录
options.compilerArgs.add('-Xbootclasspath/p:xxxservice/xxxservice.jar') // libs/framework.jar为项目相对目录
}
}
}
}
preBuild {
doLast {
def imlFile = file(project.name + ".iml")
println 'Change ' + project.name + '.iml order'
try {
def parsedXml = (new XmlParser()).parse(imlFile)
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
parsedXml.component[1].remove(jdkNode)
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform"
new groovy.util.Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
} catch (FileNotFoundException e) {
// nop, iml not found
}
}
}
|