mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-01 08:15:37 +08:00
chore: migrate build script from groovy to kts
- using SweetDependency, SweetProperty - using new maven publish function - update gradle and dependencies
This commit is contained in:
67
build.gradle
67
build.gradle
@@ -1,67 +0,0 @@
|
|||||||
import groovy.json.JsonSlurper
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
id 'com.android.application' version '7.4.1' apply false
|
|
||||||
id 'com.android.library' version '7.4.1' apply false
|
|
||||||
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
|
|
||||||
id 'com.google.devtools.ksp' version '1.8.20-1.0.10' apply false
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
|
||||||
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.11',
|
|
||||||
code: 44
|
|
||||||
],
|
|
||||||
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'
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取 Maven 授权信息 - 用于 Maven 的提交
|
|
||||||
* @param childProjectDir 子项目的目录
|
|
||||||
* @return [Object]
|
|
||||||
*/
|
|
||||||
@SuppressWarnings('unused')
|
|
||||||
static Object getMavenCredentials(File childProjectDir) {
|
|
||||||
def slurper = new JsonSlurper()
|
|
||||||
try {
|
|
||||||
return slurper.parse(new File("${childProjectDir.getParent()}/.maven/credentials.json"))
|
|
||||||
} catch (Throwable ignored) {
|
|
||||||
return slurper.parseText('{"username":"-NEEDED-","password":"-NEEDED-"}')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task clean(type: Delete) {
|
|
||||||
delete rootProject.buildDir
|
|
||||||
}
|
|
7
build.gradle.kts
Normal file
7
build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
plugins {
|
||||||
|
autowire(libs.plugins.android.application) apply false
|
||||||
|
autowire(libs.plugins.android.library) apply false
|
||||||
|
autowire(libs.plugins.kotlin.jvm) apply false
|
||||||
|
autowire(libs.plugins.kotlin.android) apply false
|
||||||
|
autowire(libs.plugins.kotlin.ksp) apply false
|
||||||
|
}
|
@@ -1,57 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'com.android.application'
|
|
||||||
id 'org.jetbrains.kotlin.android'
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace 'com.highcapable.yukihookapi.demo_app'
|
|
||||||
compileSdk rootProject.ext.android.compileSdk
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId 'com.highcapable.yukihookapi.demo_app'
|
|
||||||
|
|
||||||
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
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = '11'
|
|
||||||
freeCompilerArgs = [
|
|
||||||
'-Xno-param-assertions',
|
|
||||||
'-Xno-call-assertions',
|
|
||||||
'-Xno-receiver-assertions'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
lintOptions {
|
|
||||||
checkReleaseBuilds false
|
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
viewBinding true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'androidx.core:core-ktx:1.10.0'
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
|
|
||||||
implementation 'com.google.android.material:material:1.8.0'
|
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'com.android.application'
|
|
||||||
id 'org.jetbrains.kotlin.android'
|
|
||||||
id 'com.google.devtools.ksp'
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace 'com.highcapable.yukihookapi.demo_module'
|
|
||||||
compileSdk rootProject.ext.android.compileSdk
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId 'com.highcapable.yukihookapi.demo_module'
|
|
||||||
|
|
||||||
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
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = '11'
|
|
||||||
freeCompilerArgs = [
|
|
||||||
'-Xno-param-assertions',
|
|
||||||
'-Xno-call-assertions',
|
|
||||||
'-Xno-receiver-assertions'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
lintOptions {
|
|
||||||
checkReleaseBuilds false
|
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
viewBinding true
|
|
||||||
}
|
|
||||||
aaptOptions.additionalParameters '--allow-reserved-package-id', '--package-id', '0x64'
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// Used 82 API Version
|
|
||||||
compileOnly 'de.robv.android.xposed:api:82'
|
|
||||||
// Implementation API
|
|
||||||
implementation project(':yukihookapi')
|
|
||||||
// Implementation Processor
|
|
||||||
ksp project(':yukihookapi-ksp-xposed')
|
|
||||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
|
||||||
implementation 'androidx.core:core-ktx:1.10.0'
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
|
|
||||||
implementation 'com.google.android.material:material:1.8.0'
|
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
||||||
}
|
|
@@ -1,25 +1,35 @@
|
|||||||
# Project-wide Gradle settings.
|
# Compiler Configuration
|
||||||
# IDE (e.g. Android Studio) users:
|
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
org.gradle.jvmargs=-XX:+UseParallelGC
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
||||||
# org.gradle.parallel=true
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
||||||
# Android operating system, and which are packaged with your app"s APK
|
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
# Kotlin code style for this project: "official" or "obsolete":
|
|
||||||
kotlin.code.style=official
|
|
||||||
# Enables namespacing of each library's R class so that its R class includes only the
|
|
||||||
# resources declared in the library itself and none from the library's dependencies,
|
|
||||||
# thereby reducing the size of the R class for that library
|
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
# Incremental
|
kotlin.code.style=official
|
||||||
kotlin.incremental.useClasspathSnapshot=true
|
kotlin.incremental.useClasspathSnapshot=true
|
||||||
|
# Project Configuration
|
||||||
|
project.name=YukiHookAPI
|
||||||
|
project.description=An efficient Hook API and Xposed Module solution built in Kotlin.
|
||||||
|
project.url=https://github.com/fankes/YukiHookAPI
|
||||||
|
project.groupName=com.highcapable.yukihookapi
|
||||||
|
project.yukihookapi-core.moduleName=api
|
||||||
|
project.yukihookapi-core.version="1.0.11"
|
||||||
|
project.yukihookapi-core.kotlin-optIn.YukiPrivateApi=${project.groupName}.annotation.YukiPrivateApi
|
||||||
|
project.yukihookapi-core.kotlin-optIn.YukiGenerateApi=${project.groupName}.annotation.YukiGenerateApi
|
||||||
|
project.yukihookapi-ksp-xposed.moduleName=ksp-xposed
|
||||||
|
project.yukihookapi-ksp-xposed.version=${project.yukihookapi-core.version}
|
||||||
|
project.licence.name=MIT
|
||||||
|
project.licence.url=https://github.com/fankes/YukiHookAPI/blob/master/LICENSE
|
||||||
|
project.developer.id="0"
|
||||||
|
project.developer.name=fankes
|
||||||
|
project.developer.email=qzmmcn@163.com
|
||||||
|
project.android.compileSdk=34
|
||||||
|
project.android.minSdk=21
|
||||||
|
project.android.targetSdk=34
|
||||||
|
project.samples-demo-app.packageName=${project.groupName}.demo_app
|
||||||
|
project.samples-demo-app.versionName=universal
|
||||||
|
project.samples-demo-app.versionCode=1
|
||||||
|
project.samples-demo-module.packageName=${project.groupName}.demo_module
|
||||||
|
project.samples-demo-module.versionName=universal
|
||||||
|
project.samples-demo-module.versionCode=1
|
||||||
|
# Maven Publish Configuration
|
||||||
|
maven.publish.scm.connection=scm:git:git://github.com/fankes/YukiHookAPI.git
|
||||||
|
maven.publish.scm.developerConnection=scm:git:ssh://github.com/fankes/YukiHookAPI.git
|
||||||
|
maven.publish.scm.url=https://github.com/fankes/YukiHookAPI
|
82
gradle/sweet-dependency/sweet-dependency-config.yaml
Normal file
82
gradle/sweet-dependency/sweet-dependency-config.yaml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
preferences:
|
||||||
|
autowire-on-sync-mode: UPDATE_OPTIONAL_DEPENDENCIES
|
||||||
|
repositories-mode: FAIL_ON_PROJECT_REPOS
|
||||||
|
|
||||||
|
repositories:
|
||||||
|
gradle-plugin-portal:
|
||||||
|
scope: PLUGINS
|
||||||
|
google:
|
||||||
|
maven-central:
|
||||||
|
rovo89-xposed-api:
|
||||||
|
scope: LIBRARIES
|
||||||
|
url: https://api.xposed.info/
|
||||||
|
content:
|
||||||
|
include:
|
||||||
|
group:
|
||||||
|
de.robv.android.xposed
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
org.jetbrains.kotlin.jvm:
|
||||||
|
alias: kotlin-jvm
|
||||||
|
version: 1.9.10
|
||||||
|
org.jetbrains.kotlin.android:
|
||||||
|
alias: kotlin-android
|
||||||
|
version-ref: kotlin-jvm
|
||||||
|
com.google.devtools.ksp:
|
||||||
|
alias: kotlin-ksp
|
||||||
|
version: 1.9.10-1.0.13
|
||||||
|
com.android.application:
|
||||||
|
alias: android-application
|
||||||
|
version: 8.1.1
|
||||||
|
com.android.library:
|
||||||
|
alias: android-library
|
||||||
|
version-ref: android-application
|
||||||
|
com.vanniktech.maven.publish:
|
||||||
|
alias: maven-publish
|
||||||
|
version: 0.25.3
|
||||||
|
|
||||||
|
libraries:
|
||||||
|
de.robv.android.xposed:
|
||||||
|
api:
|
||||||
|
version: 82
|
||||||
|
repositories:
|
||||||
|
rovo89-xposed-api
|
||||||
|
com.google.devtools.ksp:
|
||||||
|
symbol-processing-api:
|
||||||
|
version: 1.9.10-1.0.13
|
||||||
|
com.google.auto.service:
|
||||||
|
auto-service-annotations:
|
||||||
|
version: 1.0.1
|
||||||
|
dev.zacsweers.autoservice:
|
||||||
|
auto-service-ksp:
|
||||||
|
version: 1.0.0
|
||||||
|
androidx.annotation:
|
||||||
|
annotation:
|
||||||
|
version: 1.6.0
|
||||||
|
androidx.preference:
|
||||||
|
preference-ktx:
|
||||||
|
version: 1.2.0
|
||||||
|
androidx.core:
|
||||||
|
core-ktx:
|
||||||
|
version: 1.10.0
|
||||||
|
androidx.appcompat:
|
||||||
|
appcompat:
|
||||||
|
version: 1.6.1
|
||||||
|
androidx.lifecycle:
|
||||||
|
lifecycle-viewmodel-ktx:
|
||||||
|
version: 2.6.1
|
||||||
|
com.google.android.material:
|
||||||
|
material:
|
||||||
|
version: 1.8.0
|
||||||
|
androidx.constraintlayout:
|
||||||
|
constraintlayout:
|
||||||
|
version: 2.1.4
|
||||||
|
androidx.test.ext:
|
||||||
|
junit:
|
||||||
|
version: 1.1.5
|
||||||
|
androidx.test.espresso:
|
||||||
|
espresso-core:
|
||||||
|
version: 3.5.1
|
||||||
|
junit:
|
||||||
|
junit:
|
||||||
|
version: 4.13.2
|
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
|||||||
#Sat Jan 29 22:55:22 CST 2022
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
52
samples/demo-app/build.gradle.kts
Normal file
52
samples/demo-app/build.gradle.kts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
plugins {
|
||||||
|
autowire(libs.plugins.android.application)
|
||||||
|
autowire(libs.plugins.kotlin.android)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = property.project.samples.demo.app.packageName
|
||||||
|
compileSdk = property.project.android.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId = property.project.samples.demo.app.packageName
|
||||||
|
minSdk = property.project.android.minSdk
|
||||||
|
targetSdk = property.project.android.targetSdk
|
||||||
|
versionName = property.project.samples.demo.app.versionName
|
||||||
|
versionCode = property.project.samples.demo.app.versionCode
|
||||||
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = false
|
||||||
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
freeCompilerArgs = listOf(
|
||||||
|
"-Xno-param-assertions",
|
||||||
|
"-Xno-call-assertions",
|
||||||
|
"-Xno-receiver-assertions"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
|
viewBinding = true
|
||||||
|
}
|
||||||
|
lint { checkReleaseBuilds = false }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(androidx.core.core.ktx)
|
||||||
|
implementation(androidx.appcompat.appcompat)
|
||||||
|
implementation(androidx.lifecycle.lifecycle.viewmodel.ktx)
|
||||||
|
implementation(com.google.android.material.material)
|
||||||
|
implementation(androidx.constraintlayout.constraintlayout)
|
||||||
|
testImplementation(junit.junit)
|
||||||
|
androidTestImplementation(androidx.test.ext.junit)
|
||||||
|
androidTestImplementation(androidx.test.espresso.espresso.core)
|
||||||
|
}
|
58
samples/demo-module/build.gradle.kts
Normal file
58
samples/demo-module/build.gradle.kts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
plugins {
|
||||||
|
autowire(libs.plugins.android.application)
|
||||||
|
autowire(libs.plugins.kotlin.android)
|
||||||
|
autowire(libs.plugins.kotlin.ksp)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = property.project.samples.demo.module.packageName
|
||||||
|
compileSdk = property.project.android.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId = property.project.samples.demo.module.packageName
|
||||||
|
minSdk = property.project.android.minSdk
|
||||||
|
targetSdk = property.project.android.targetSdk
|
||||||
|
versionName = property.project.samples.demo.module.versionName
|
||||||
|
versionCode = property.project.samples.demo.module.versionCode
|
||||||
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = false
|
||||||
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
freeCompilerArgs = listOf(
|
||||||
|
"-Xno-param-assertions",
|
||||||
|
"-Xno-call-assertions",
|
||||||
|
"-Xno-receiver-assertions"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
buildFeatures {
|
||||||
|
buildConfig = true
|
||||||
|
viewBinding = true
|
||||||
|
}
|
||||||
|
lint { checkReleaseBuilds = false }
|
||||||
|
androidResources.additionalParameters += listOf("--allow-reserved-package-id", "--package-id", "0x64")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly(de.robv.android.xposed.api)
|
||||||
|
implementation(projects.yukihookapiCore)
|
||||||
|
ksp(projects.yukihookapiKspXposed)
|
||||||
|
implementation(androidx.preference.preference.ktx)
|
||||||
|
implementation(androidx.core.core.ktx)
|
||||||
|
implementation(androidx.appcompat.appcompat)
|
||||||
|
implementation(androidx.lifecycle.lifecycle.viewmodel.ktx)
|
||||||
|
implementation(com.google.android.material.material)
|
||||||
|
implementation(androidx.constraintlayout.constraintlayout)
|
||||||
|
testImplementation(junit.junit)
|
||||||
|
androidTestImplementation(androidx.test.ext.junit)
|
||||||
|
androidTestImplementation(androidx.test.espresso.espresso.core)
|
||||||
|
}
|
@@ -1,21 +0,0 @@
|
|||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
gradlePluginPortal()
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dependencyResolutionManagement {
|
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
maven { url "https://api.xposed.info/" }
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rootProject.name = "YukiHookAPI"
|
|
||||||
include ':demo-app'
|
|
||||||
include ':demo-module'
|
|
||||||
include ':yukihookapi'
|
|
||||||
include ':yukihookapi-ksp-xposed'
|
|
||||||
include ':yukihookapi-stub'
|
|
30
settings.gradle.kts
Normal file
30
settings.gradle.kts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugins {
|
||||||
|
id("com.highcapable.sweetdependency") version "1.0.1"
|
||||||
|
id("com.highcapable.sweetproperty") version "1.0.2"
|
||||||
|
}
|
||||||
|
sweetProperty {
|
||||||
|
global {
|
||||||
|
sourcesCode {
|
||||||
|
includeKeys("^project\\..*\$".toRegex())
|
||||||
|
isEnableRestrictedAccess = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rootProject { all { isEnable = false } }
|
||||||
|
project("samples") { all { isEnable = false } }
|
||||||
|
project("samples:demo-app") { sourcesCode { isEnable = false } }
|
||||||
|
project("samples:demo-module") { sourcesCode { isEnable = false } }
|
||||||
|
project("yukihookapi-core") { sourcesCode { className = rootProject.name } }
|
||||||
|
project("yukihookapi-ksp-xposed") { sourcesCode { className = rootProject.name } }
|
||||||
|
project("yukihookapi-stub") { sourcesCode { isEnable = false } }
|
||||||
|
}
|
||||||
|
rootProject.name = "YukiHookAPI"
|
||||||
|
include(":samples:demo-app", ":samples:demo-module")
|
||||||
|
include(":yukihookapi-core", ":yukihookapi-ksp-xposed", ":yukihookapi-stub")
|
85
yukihookapi-core/build.gradle.kts
Normal file
85
yukihookapi-core/build.gradle.kts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
plugins {
|
||||||
|
autowire(libs.plugins.android.library)
|
||||||
|
autowire(libs.plugins.kotlin.android)
|
||||||
|
autowire(libs.plugins.maven.publish)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = property.project.groupName
|
||||||
|
compileSdk = property.project.android.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk = property.project.android.minSdk
|
||||||
|
consumerProguardFiles("consumer-rules.pro")
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = false
|
||||||
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
freeCompilerArgs = listOf(
|
||||||
|
"-opt-in=${property.project.yukihookapi.core.kotlin.optIn.yukiPrivateApi}",
|
||||||
|
"-opt-in=${property.project.yukihookapi.core.kotlin.optIn.yukiGenerateApi}",
|
||||||
|
"-Xno-param-assertions",
|
||||||
|
"-Xno-call-assertions",
|
||||||
|
"-Xno-receiver-assertions"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
lint { checkReleaseBuilds = false }
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
sourceSets {
|
||||||
|
all {
|
||||||
|
languageSettings {
|
||||||
|
optIn(property.project.yukihookapi.core.kotlin.optIn.yukiPrivateApi)
|
||||||
|
optIn(property.project.yukihookapi.core.kotlin.optIn.yukiGenerateApi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly(de.robv.android.xposed.api)
|
||||||
|
compileOnly(projects.yukihookapiStub)
|
||||||
|
implementation(androidx.core.core.ktx)
|
||||||
|
implementation(androidx.appcompat.appcompat)
|
||||||
|
implementation(androidx.preference.preference.ktx)
|
||||||
|
}
|
||||||
|
|
||||||
|
mavenPublishing {
|
||||||
|
coordinates(property.project.groupName, property.project.yukihookapi.core.moduleName, property.project.yukihookapi.core.version)
|
||||||
|
pom {
|
||||||
|
name = property.project.name
|
||||||
|
description = property.project.description
|
||||||
|
url = property.project.url
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = property.project.licence.name
|
||||||
|
url = property.project.licence.url
|
||||||
|
distribution = property.project.licence.url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = property.project.developer.id
|
||||||
|
name = property.project.developer.name
|
||||||
|
email = property.project.developer.email
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url = property.maven.publish.scm.url
|
||||||
|
connection = property.maven.publish.scm.connection
|
||||||
|
developerConnection = property.maven.publish.scm.developerConnection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.S01)
|
||||||
|
signAllPublications()
|
||||||
|
}
|
@@ -1,81 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'java-library'
|
|
||||||
id 'org.jetbrains.kotlin.jvm'
|
|
||||||
id 'com.google.devtools.ksp'
|
|
||||||
id 'maven-publish'
|
|
||||||
id 'signing'
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
|
||||||
withJavadocJar()
|
|
||||||
withSourcesJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
javadoc {
|
|
||||||
options.addStringOption("charset", "UTF-8")
|
|
||||||
if (JavaVersion.current().isJava9Compatible()) options.addBooleanOption('html5', true)
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin { sourceSets.main { kotlin.srcDir("src/api/kotlin") } }
|
|
||||||
|
|
||||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = 11
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'com.google.auto.service:auto-service-annotations:1.0.1'
|
|
||||||
compileOnly 'com.google.devtools.ksp:symbol-processing-api:1.8.20-1.0.10'
|
|
||||||
ksp 'dev.zacsweers.autoservice:auto-service-ksp:1.0.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
group = rootProject.ext.maven.repository.groupId
|
|
||||||
version = rootProject.ext.maven.repository.apiVersion.name
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
mavenJava(MavenPublication) {
|
|
||||||
artifactId = 'ksp-xposed'
|
|
||||||
from components.java
|
|
||||||
pom {
|
|
||||||
name = rootProject.ext.maven.repository.name
|
|
||||||
description = rootProject.ext.maven.repository.description
|
|
||||||
url = rootProject.ext.maven.repository.website
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name = rootProject.ext.maven.repository.licence.name
|
|
||||||
url = rootProject.ext.maven.repository.licence.url
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id = rootProject.ext.maven.developer.id
|
|
||||||
name = rootProject.ext.maven.developer.user
|
|
||||||
email = rootProject.ext.maven.developer.email
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scm {
|
|
||||||
connection = rootProject.ext.maven.configurations.githubConnection
|
|
||||||
developerConnection = rootProject.ext.maven.configurations.githubDeveloperConnection
|
|
||||||
url = rootProject.ext.maven.configurations.githubUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = rootProject.ext.maven.configurations.ossName
|
|
||||||
url = rootProject.ext.maven.configurations.ossUrl
|
|
||||||
credentials {
|
|
||||||
def configs = getMavenCredentials(projectDir)
|
|
||||||
username = configs.username
|
|
||||||
password = configs.password
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signing { sign(publishing.publications.mavenJava) }
|
|
60
yukihookapi-ksp-xposed/build.gradle.kts
Normal file
60
yukihookapi-ksp-xposed/build.gradle.kts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
plugins {
|
||||||
|
autowire(libs.plugins.kotlin.jvm)
|
||||||
|
autowire(libs.plugins.kotlin.ksp)
|
||||||
|
autowire(libs.plugins.maven.publish)
|
||||||
|
}
|
||||||
|
|
||||||
|
group = property.project.groupName
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
sourceSets.getByName("main") {
|
||||||
|
kotlin.srcDir("src/api/kotlin")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(com.google.auto.service.auto.service.annotations)
|
||||||
|
compileOnly(com.google.devtools.ksp.symbol.processing.api)
|
||||||
|
ksp(dev.zacsweers.autoservice.auto.service.ksp)
|
||||||
|
}
|
||||||
|
|
||||||
|
mavenPublishing {
|
||||||
|
coordinates(property.project.groupName, property.project.yukihookapi.ksp.xposed.moduleName, property.project.yukihookapi.ksp.xposed.version)
|
||||||
|
pom {
|
||||||
|
name = property.project.name
|
||||||
|
description = property.project.description
|
||||||
|
url = property.project.url
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = property.project.licence.name
|
||||||
|
url = property.project.licence.url
|
||||||
|
distribution = property.project.licence.url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = property.project.developer.id
|
||||||
|
name = property.project.developer.name
|
||||||
|
email = property.project.developer.email
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
url = property.maven.publish.scm.url
|
||||||
|
connection = property.maven.publish.scm.connection
|
||||||
|
developerConnection = property.maven.publish.scm.developerConnection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.S01)
|
||||||
|
signAllPublications()
|
||||||
|
}
|
@@ -1,42 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'com.android.library'
|
|
||||||
id 'org.jetbrains.kotlin.android'
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace 'com.highcapable.yukihookapi.stub'
|
|
||||||
compileSdk rootProject.ext.android.compileSdk
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdk rootProject.ext.android.minSdk
|
|
||||||
targetSdk rootProject.ext.android.targetSdk
|
|
||||||
|
|
||||||
consumerProguardFiles 'consumer-rules.pro'
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled false
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = '11'
|
|
||||||
freeCompilerArgs = [
|
|
||||||
'-Xno-param-assertions',
|
|
||||||
'-Xno-call-assertions',
|
|
||||||
'-Xno-receiver-assertions'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
lintOptions {
|
|
||||||
checkReleaseBuilds false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'androidx.annotation:annotation:1.6.0'
|
|
||||||
}
|
|
37
yukihookapi-stub/build.gradle.kts
Normal file
37
yukihookapi-stub/build.gradle.kts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
plugins {
|
||||||
|
autowire(libs.plugins.android.library)
|
||||||
|
autowire(libs.plugins.kotlin.android)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = property.project.groupName
|
||||||
|
compileSdk = property.project.android.compileSdk
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk = property.project.android.minSdk
|
||||||
|
consumerProguardFiles("consumer-rules.pro")
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = false
|
||||||
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
freeCompilerArgs = listOf(
|
||||||
|
"-Xno-param-assertions",
|
||||||
|
"-Xno-call-assertions",
|
||||||
|
"-Xno-receiver-assertions"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
lint { checkReleaseBuilds = false }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(androidx.annotation.annotation)
|
||||||
|
}
|
@@ -1,125 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'com.android.library'
|
|
||||||
id 'org.jetbrains.kotlin.android'
|
|
||||||
id 'maven-publish'
|
|
||||||
id 'signing'
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace 'com.highcapable.yukihookapi'
|
|
||||||
compileSdk rootProject.ext.android.compileSdk
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
minSdk rootProject.ext.android.minSdk
|
|
||||||
targetSdk rootProject.ext.android.targetSdk
|
|
||||||
|
|
||||||
buildConfigField('String', 'API_VERSION_NAME', "\"${rootProject.ext.maven.repository.apiVersion.name}\"")
|
|
||||||
buildConfigField('int', 'API_VERSION_CODE', "${rootProject.ext.maven.repository.apiVersion.code}")
|
|
||||||
|
|
||||||
consumerProguardFiles 'consumer-rules.pro'
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled false
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = '11'
|
|
||||||
freeCompilerArgs = [
|
|
||||||
'-opt-in=com.highcapable.yukihookapi.annotation.YukiPrivateApi',
|
|
||||||
'-opt-in=com.highcapable.yukihookapi.annotation.YukiGenerateApi',
|
|
||||||
'-Xno-param-assertions',
|
|
||||||
'-Xno-call-assertions',
|
|
||||||
'-Xno-receiver-assertions'
|
|
||||||
]
|
|
||||||
}
|
|
||||||
lintOptions {
|
|
||||||
checkReleaseBuilds false
|
|
||||||
}
|
|
||||||
publishing {
|
|
||||||
singleVariant('release') {
|
|
||||||
withSourcesJar()
|
|
||||||
withJavadocJar()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
sourceSets {
|
|
||||||
all {
|
|
||||||
languageSettings {
|
|
||||||
optIn('com.highcapable.yukihookapi.annotation.YukiPrivateApi')
|
|
||||||
optIn('com.highcapable.yukihookapi.annotation.YukiGenerateApi')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// Used 82 API Version
|
|
||||||
compileOnly 'de.robv.android.xposed:api:82'
|
|
||||||
compileOnly project(':yukihookapi-stub')
|
|
||||||
implementation 'androidx.core:core-ktx:1.10.0'
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
||||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register('androidSourcesJar', Jar) {
|
|
||||||
archiveClassifier.set('sources')
|
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
}
|
|
||||||
|
|
||||||
group = rootProject.ext.maven.repository.groupId
|
|
||||||
version = rootProject.ext.maven.repository.apiVersion.name
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
release(MavenPublication) {
|
|
||||||
artifactId = 'api'
|
|
||||||
artifact "$buildDir/outputs/aar/${project.name}-release.aar"
|
|
||||||
artifact androidSourcesJar
|
|
||||||
pom {
|
|
||||||
name = rootProject.ext.maven.repository.name
|
|
||||||
description = rootProject.ext.maven.repository.description
|
|
||||||
url = rootProject.ext.maven.repository.website
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name = rootProject.ext.maven.repository.licence.name
|
|
||||||
url = rootProject.ext.maven.repository.licence.url
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id = rootProject.ext.maven.developer.id
|
|
||||||
name = rootProject.ext.maven.developer.user
|
|
||||||
email = rootProject.ext.maven.developer.email
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scm {
|
|
||||||
connection = rootProject.ext.maven.configurations.githubConnection
|
|
||||||
developerConnection = rootProject.ext.maven.configurations.githubDeveloperConnection
|
|
||||||
url = rootProject.ext.maven.configurations.githubUrl
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = rootProject.ext.maven.configurations.ossName
|
|
||||||
url = rootProject.ext.maven.configurations.ossUrl
|
|
||||||
credentials {
|
|
||||||
def configs = getMavenCredentials(projectDir)
|
|
||||||
username = configs.username
|
|
||||||
password = configs.password
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signing { sign publishing.publications }
|
|
Reference in New Issue
Block a user