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 uses: actions/checkout@v3
with: with:
submodules: 'recursive' submodules: 'recursive'
fetch-depth: 0
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:

View File

@ -1,4 +1,6 @@
import java.nio.file.Paths import java.nio.file.Paths
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.storage.file.FileRepositoryBuilder
plugins { plugins {
id("com.android.library") id("com.android.library")
@ -6,6 +8,15 @@ plugins {
id("signing") 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 androidTargetSdkVersion: Int by rootProject.extra
val androidMinSdkVersion: Int by rootProject.extra val androidMinSdkVersion: Int by rootProject.extra
val androidBuildToolsVersion: String by rootProject.extra val androidBuildToolsVersion: String by rootProject.extra
@ -173,11 +184,18 @@ val symbolsStandaloneTask = tasks.register<Jar>("generateStandaloneSymbolsJar")
archiveClassifier.set("symbols") 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 { publishing {
publications { publications {
fun MavenPublication.setup() { fun MavenPublication.setup() {
group = "org.lsposed.lsplant" group = "org.lsposed.lsplant"
version = "5.2" version = ver
pom { pom {
name.set("LSPlant") name.set("LSPlant")
description.set("A hook framework for Android Runtime (ART)") description.set("A hook framework for Android Runtime (ART)")

View File

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