hch
2024-10-29 bac09da064c5a02dcd8dad29e28b31ea4b94428b
SdkProject/library/build.gradle
@@ -1,6 +1,7 @@
plugins {
    id 'com.android.library'
}
def rootPath = rootProject.getRootDir().getAbsolutePath()
def channelPath = "${rootPath}/channel/${CHANNEL_NAME}"
@@ -32,18 +33,20 @@
def channelJavaFiles = getAllFiles(new ArrayList<File>(), "${channelPath}/java")
android {
    compileSdkVersion 29
    buildToolsVersion "28.0.1"
    compileSdkVersion 30
    buildToolsVersion "30.0.0"
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
//        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
        multiDexEnabled true
    }
    flavorDimensions "version"
    productFlavors {
@@ -59,9 +62,10 @@
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    packagingOptions {exclude 'META-INF/rxjava.properties'}
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
@@ -138,7 +142,8 @@
}
task deleteSdk() {
    delete "${outPutPath}\\${CHANNEL_NAME}"
    delete "${outPutPath}\\${CHANNEL_NAME}\\debug"
    delete "${outPutPath}\\${CHANNEL_NAME}\\release"
}
//执行打包任务以及拷贝到外部
@@ -171,21 +176,26 @@
    def dir = new File("${outPutPath}\\${CHANNEL_NAME}")
    def libraries = new File("${outPutPath}\\${CHANNEL_NAME}\\deps.gradle")
    dir.mkdir()
    if (libraries.exists())
        libraries.delete()
    if (!libraries.exists())
        libraries.createNewFile()
    libraries.text = content
}
dependencies {
    implementation 'com.android.support:support-annotations:28.0.0'
    testImplementation 'junit:junit:4.13.1'
//    implementation 'com.android.support:support-annotations:28.0.0'
//    testImplementation 'junit:junit:4.13.2'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
//    implementation 'com.android.support:appcompat-v7:28.0.0'
//    implementation 'com.github.pqpo:Log4a:1.4.2@aar'
    implementation fileTree(dir: "../channel/${CHANNEL_NAME}/libs/", include: ['*.jar'])
    plugins.each {
        implementation fileTree(dir: "${rootPath}/plugins/${it}/libs/", include: ['*.jar'])
    }
    implementation fileTree(dir: 'libs', include: ['*.jar'], exclude: ['unity-classes.jar'])
    compileOnly files('libs/unity-classes.jar')
}