Use latest tag for publication

This commit is contained in:
LoveSy 2022-11-29 15:32:02 +08:00
parent a2b5d87159
commit 65a276ff91
No known key found for this signature in database
3 changed files with 22 additions and 3 deletions

View File

@ -22,6 +22,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:

View File

@ -1,4 +1,6 @@
import java.nio.file.Paths
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.storage.file.FileRepositoryBuilder
plugins {
id("com.android.library")
@ -6,6 +8,15 @@ plugins {
id("signing")
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r")
}
}
val androidTargetSdkVersion: Int by rootProject.extra
val androidMinSdkVersion: Int by rootProject.extra
val androidBuildToolsVersion: String by rootProject.extra
@ -173,11 +184,18 @@ val symbolsStandaloneTask = tasks.register<Jar>("generateStandaloneSymbolsJar")
archiveClassifier.set("symbols")
}
val ver = FileRepositoryBuilder().findGitDir(rootProject.file(".git")).runCatching {
build().use {
Git(it).describe().setTags(true).setAbbrev(0).call().removePrefix("v")
}
}.getOrNull() ?: "0.0"
println("${rootProject.name} version: $ver")
publishing {
publications {
fun MavenPublication.setup() {
group = "org.lsposed.lsplant"
version = "5.2"
version = ver
pom {
name.set("LSPlant")
description.set("A hook framework for Android Runtime (ART)")
@ -233,7 +251,7 @@ publishing {
}
}
dependencies {
"standaloneCompileOnly"("dev.rikka.ndk.thirdparty:cxx:1.2.0")
"standaloneCompileOnly"("dev.rikka.ndk.thirdparty:cxx:1.2.0")
}
}

View File

@ -4,7 +4,7 @@
#include <string_view>
/// \namespace namespace of LSPlant
/// \namespace lsplant
namespace lsplant {
inline namespace v2 {