Merge Gradle code

This commit is contained in:
2022-02-14 13:23:59 +08:00
parent 8da4226d31
commit daf8ea1ffd
4 changed files with 76 additions and 79 deletions

View File

@@ -1,28 +1,36 @@
buildscript {
ext.kotlin_version = "1.6.10"
repositories {
google()
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url "https://www.jitpack.io" }
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
//file:noinspection unused
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}
allprojects {
repositories {
google()
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url "https://www.jitpack.io" }
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
mavenCentral()
ext {
kotlinVersion = "1.6.10"
devId = "0"
devUser = "fankesyooni"
userEmail = 'qzmmcn@163.com'
groupId = "com.highcapable.yukihookapi"
apiVersion = "1.0"
repoName = "YukiHookAPI"
repoDescription = "An efficient Kotlin version of the Xposed Hook API."
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/"
}
static String getFileContent(String name) {
FileReader reader = new FileReader("/Users/fankes/ProjectPath/AndroidStudioProjects/YukiHookAPI/.gradle/" + name)
BufferedReader buff = new BufferedReader(reader)
String result = buff.readLine()
buff.close()
reader.close()
return result
}
task clean(type: Delete) {

View File

@@ -1,3 +1,18 @@
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'

View File

@@ -26,8 +26,8 @@ dependencies {
ksp 'dev.zacsweers.autoservice:auto-service-ksp:1.0.0'
}
group = 'com.highcapable.yukihookapi'
version = '1.0'
group = rootProject.ext.groupId
version = rootProject.ext.apiVersion
publishing {
publications {
@@ -35,38 +35,34 @@ publishing {
artifactId = 'ksp-xposed'
from components.java
pom {
name = 'YukiHookAPI'
description = 'An efficient Kotlin version of the Xposed Hook API.'
url = 'https://github.com/fankes/YukiHookAPI'
name = rootProject.ext.repoName
description = rootProject.ext.repoDescription
url = rootProject.ext.website
licenses {
license {
name = 'MIT License'
url = 'https://github.com/fankes/YukiHookAPI/blob/master/LICENSE'
name = rootProject.ext.licenceName
url = rootProject.ext.licenceUrl
}
}
developers {
developer {
id = '0'
name = 'fankesyooni'
email = 'qzmmcn@163.com'
id = rootProject.ext.devId
name = rootProject.ext.devUser
email = rootProject.ext.userEmail
}
}
scm {
connection = 'scm:git:git://github.com/path/to/repo.git'
developerConnection = 'scm:git:ssh://github.com/path/to/repo.git'
url = 'https://github.com/path/to/repo'
connection = rootProject.ext.githubConnection
developerConnection = rootProject.ext.githubDeveloperConnection
url = rootProject.ext.githubUrl
}
}
}
}
repositories {
maven {
name = "OSSRH"
if (project.version.toString().endsWith("-SNAPSHOT")) {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots"
} else {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
name = rootProject.ext.ossName
url = rootProject.ext.ossUrl
credentials {
username = getFileContent("OSSRH_USERNAME")
password = getFileContent("OSSRH_PASSWORD")
@@ -78,12 +74,3 @@ publishing {
signing {
sign(publishing.publications.mavenJava)
}
private static String getFileContent(String name) {
FileReader reader = new FileReader("/Users/fankes/ProjectPath/AndroidStudioProjects/YukiHookAPI/.gradle/" + name)
BufferedReader buff = new BufferedReader(reader)
String result = buff.readLine()
buff.close()
reader.close()
return result
}

View File

@@ -27,8 +27,8 @@ dependencies {
implementation 'androidx.annotation:annotation:1.3.0'
}
group = 'com.highcapable.yukihookapi'
version = '1.0'
group = rootProject.ext.groupId
version = rootProject.ext.apiVersion
publishing {
publications {
@@ -36,38 +36,34 @@ publishing {
artifactId = 'api'
from components.java
pom {
name = 'YukiHookAPI'
description = 'An efficient Kotlin version of the Xposed Hook API.'
url = 'https://github.com/fankes/YukiHookAPI'
name = rootProject.ext.repoName
description = rootProject.ext.repoDescription
url = rootProject.ext.website
licenses {
license {
name = 'MIT License'
url = 'https://github.com/fankes/YukiHookAPI/blob/master/LICENSE'
name = rootProject.ext.licenceName
url = rootProject.ext.licenceUrl
}
}
developers {
developer {
id = '0'
name = 'fankesyooni'
email = 'qzmmcn@163.com'
id = rootProject.ext.devId
name = rootProject.ext.devUser
email = rootProject.ext.userEmail
}
}
scm {
connection = 'scm:git:git://github.com/path/to/repo.git'
developerConnection = 'scm:git:ssh://github.com/path/to/repo.git'
url = 'https://github.com/path/to/repo'
connection = rootProject.ext.githubConnection
developerConnection = rootProject.ext.githubDeveloperConnection
url = rootProject.ext.githubUrl
}
}
}
}
repositories {
maven {
name = "OSSRH"
if (project.version.toString().endsWith("-SNAPSHOT")) {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots"
} else {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
name = rootProject.ext.ossName
url = rootProject.ext.ossUrl
credentials {
username = getFileContent("OSSRH_USERNAME")
password = getFileContent("OSSRH_PASSWORD")
@@ -79,12 +75,3 @@ publishing {
signing {
sign(publishing.publications.mavenJava)
}
private static String getFileContent(String name) {
FileReader reader = new FileReader("/Users/fankes/ProjectPath/AndroidStudioProjects/YukiHookAPI/.gradle/" + name)
BufferedReader buff = new BufferedReader(reader)
String result = buff.readLine()
buff.close()
reader.close()
return result
}