diff --git a/build.gradle b/build.gradle index 999991b9..0c92047f 100644 --- a/build.gradle +++ b/build.gradle @@ -8,21 +8,43 @@ plugins { } ext { - devId = "0" - devUser = "fankesyooni" - userEmail = "qzmmcn@163.com" - groupId = "com.highcapable.yukihookapi" - apiVersion = "1.1.8" - repoName = "YukiHookAPI" - repoDescription = "An efficient Hook API and Xposed Module solution built in Kotlin." - licenceName = "MIT License" - licenceUrl = "https://github.com/fankes/YukiHookAPI/blob/master/LICENSE" - website = "https://github.com/fankes/YukiHookAPI" - githubConnection = "scm:git:git://github.com/path/to/repo.git" - githubDeveloperConnection = "scm:git:ssh://github.com/path/to/repo.git" - githubUrl = "https://github.com/path/to/repo" - ossName = "OSSRH" - ossUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + android = [ + compileSdk: 33, + minSdk : 21, + targetSdk : 33 + ] + app = [ + versionName: 'universal', + versionCode: 1 + ] + maven = [ + developer : [ + id : '0', + user : 'fankesyooni', + email: 'qzmmcn@163.com' + ], + repository : [ + groupId : 'com.highcapable.yukihookapi', + apiVersion : [ + name: '1.1.8', + code: 41 + ], + name : 'YukiHookAPI', + description: 'An efficient Hook API and Xposed Module solution built in Kotlin.', + website : 'https://github.com/fankes/YukiHookAPI', + licence : [ + name: 'MIT License', + url : 'https://github.com/fankes/YukiHookAPI/blob/master/LICENSE' + ] + ], + configurations: [ + githubConnection : 'scm:git:git://github.com/path/to/repo.git', + githubDeveloperConnection: 'scm:git:ssh://github.com/path/to/repo.git', + githubUrl : 'https://github.com/path/to/repo', + ossName : 'OSSRH', + ossUrl : 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2' + ] + ] } /** diff --git a/demo-app/build.gradle b/demo-app/build.gradle index 082c233d..709d83ce 100644 --- a/demo-app/build.gradle +++ b/demo-app/build.gradle @@ -4,33 +4,24 @@ plugins { } android { - signingConfigs { - debug { - storeFile file('../keystore/public') - storePassword '123456' - keyAlias 'public' - keyPassword '123456' - v1SigningEnabled true - v2SigningEnabled true - } - } - - compileSdk 33 + namespace 'com.highcapable.yukihookapi.demo_app' + compileSdk rootProject.ext.android.compileSdk defaultConfig { - applicationId "com.highcapable.yukihookapi.demo_app" - minSdk 21 - targetSdk 33 - versionCode 1 - versionName "1.0" + applicationId 'com.highcapable.yukihookapi.demo_app' - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + minSdk rootProject.ext.android.minSdk + targetSdk rootProject.ext.android.targetSdk + + versionCode rootProject.ext.app.versionCode + versionName rootProject.ext.app.versionName + + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { minifyEnabled false - signingConfig signingConfigs.debug proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -40,6 +31,14 @@ android { } kotlinOptions { jvmTarget = '11' + freeCompilerArgs = [ + '-Xno-param-assertions', + '-Xno-call-assertions', + '-Xno-receiver-assertions' + ] + } + lintOptions { + checkReleaseBuilds false } buildFeatures { viewBinding true diff --git a/demo-module/build.gradle b/demo-module/build.gradle index 56dc040a..1be4a93e 100644 --- a/demo-module/build.gradle +++ b/demo-module/build.gradle @@ -1,37 +1,28 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' - id 'com.google.devtools.ksp' version '1.8.20-1.0.10' + id 'com.google.devtools.ksp' } android { - signingConfigs { - debug { - storeFile file('../keystore/public') - storePassword '123456' - keyAlias 'public' - keyPassword '123456' - v1SigningEnabled true - v2SigningEnabled true - } - } - - compileSdk 33 + namespace 'com.highcapable.yukihookapi.demo_module' + compileSdk rootProject.ext.android.compileSdk defaultConfig { - applicationId "com.highcapable.yukihookapi.demo_module" - minSdk 21 - targetSdk 33 - versionCode 1 - versionName "1.0" + applicationId 'com.highcapable.yukihookapi.demo_module' - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + minSdk rootProject.ext.android.minSdk + targetSdk rootProject.ext.android.targetSdk + + versionCode rootProject.ext.app.versionCode + versionName rootProject.ext.app.versionName + + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes { release { minifyEnabled false - signingConfig signingConfigs.debug proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } @@ -47,6 +38,9 @@ android { '-Xno-receiver-assertions' ] } + lintOptions { + checkReleaseBuilds false + } buildFeatures { viewBinding true } diff --git a/keystore/public b/keystore/public deleted file mode 100644 index 4d536971..00000000 Binary files a/keystore/public and /dev/null differ diff --git a/yukihookapi-ksp-xposed/build.gradle b/yukihookapi-ksp-xposed/build.gradle index 6e17fe3a..24a40b04 100644 --- a/yukihookapi-ksp-xposed/build.gradle +++ b/yukihookapi-ksp-xposed/build.gradle @@ -32,8 +32,8 @@ dependencies { ksp 'dev.zacsweers.autoservice:auto-service-ksp:1.0.0' } -group = rootProject.ext.groupId -version = rootProject.ext.apiVersion +group = rootProject.ext.maven.repository.groupId +version = rootProject.ext.maven.repository.apiVersion.name publishing { publications { @@ -41,34 +41,34 @@ publishing { artifactId = 'ksp-xposed' from components.java pom { - name = rootProject.ext.repoName - description = rootProject.ext.repoDescription - url = rootProject.ext.website + name = rootProject.ext.maven.repository.name + description = rootProject.ext.maven.repository.description + url = rootProject.ext.maven.repository.website licenses { license { - name = rootProject.ext.licenceName - url = rootProject.ext.licenceUrl + name = rootProject.ext.maven.repository.licence.name + url = rootProject.ext.maven.repository.licence.url } } developers { developer { - id = rootProject.ext.devId - name = rootProject.ext.devUser - email = rootProject.ext.userEmail + id = rootProject.ext.maven.developer.id + name = rootProject.ext.maven.developer.user + email = rootProject.ext.maven.developer.email } } scm { - connection = rootProject.ext.githubConnection - developerConnection = rootProject.ext.githubDeveloperConnection - url = rootProject.ext.githubUrl + connection = rootProject.ext.maven.configurations.githubConnection + developerConnection = rootProject.ext.maven.configurations.githubDeveloperConnection + url = rootProject.ext.maven.configurations.githubUrl } } } } repositories { maven { - name = rootProject.ext.ossName - url = rootProject.ext.ossUrl + name = rootProject.ext.maven.configurations.ossName + url = rootProject.ext.maven.configurations.ossUrl credentials { def configs = getMavenCredentials(projectDir) username = configs.username @@ -78,6 +78,4 @@ publishing { } } -signing { - sign(publishing.publications.mavenJava) -} \ No newline at end of file +signing { sign(publishing.publications.mavenJava) } \ No newline at end of file diff --git a/yukihookapi/build.gradle b/yukihookapi/build.gradle index a8dd93b6..c153a115 100644 --- a/yukihookapi/build.gradle +++ b/yukihookapi/build.gradle @@ -51,8 +51,8 @@ dependencies { implementation 'androidx.annotation:annotation:1.6.0' } -group = rootProject.ext.groupId -version = rootProject.ext.apiVersion +group = rootProject.ext.maven.repository.groupId +version = rootProject.ext.maven.repository.apiVersion.name publishing { publications { @@ -60,34 +60,34 @@ publishing { artifactId = 'api' from components.java pom { - name = rootProject.ext.repoName - description = rootProject.ext.repoDescription - url = rootProject.ext.website + name = rootProject.ext.maven.repository.name + description = rootProject.ext.maven.repository.description + url = rootProject.ext.maven.repository.website licenses { license { - name = rootProject.ext.licenceName - url = rootProject.ext.licenceUrl + name = rootProject.ext.maven.repository.licence.name + url = rootProject.ext.maven.repository.licence.url } } developers { developer { - id = rootProject.ext.devId - name = rootProject.ext.devUser - email = rootProject.ext.userEmail + id = rootProject.ext.maven.developer.id + name = rootProject.ext.maven.developer.user + email = rootProject.ext.maven.developer.email } } scm { - connection = rootProject.ext.githubConnection - developerConnection = rootProject.ext.githubDeveloperConnection - url = rootProject.ext.githubUrl + connection = rootProject.ext.maven.configurations.githubConnection + developerConnection = rootProject.ext.maven.configurations.githubDeveloperConnection + url = rootProject.ext.maven.configurations.githubUrl } } } } repositories { maven { - name = rootProject.ext.ossName - url = rootProject.ext.ossUrl + name = rootProject.ext.maven.configurations.ossName + url = rootProject.ext.maven.configurations.ossUrl credentials { def configs = getMavenCredentials(projectDir) username = configs.username @@ -97,6 +97,4 @@ publishing { } } -signing { - sign(publishing.publications.mavenJava) -} \ No newline at end of file +signing { sign(publishing.publications.mavenJava) } \ No newline at end of file