Skip to content
This repository was archived by the owner on May 3, 2025. It is now read-only.

Commit 4d017e7

Browse files
committed
API changed, version up, github release
1 parent 8ad259c commit 4d017e7

File tree

2 files changed

+15
-34
lines changed

2 files changed

+15
-34
lines changed

.travis.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,17 @@ cache:
1010
- $HOME/.gradle/wrapper/
1111
deploy:
1212
provider: script
13-
script: ./gradlew publishPlugins -Pgradle.publish.key=$GRADLE_PLUGIN_KEY -Pgradle.publish.secret=$GRADLE_PLUGIN_SECRET
13+
script: ./gradlew publishPlugins -Pgradle.publish.key=$GRADLE_PLUGIN_KEY -Pgradle.publish.secret=$GRADLE_PLUGIN_SECRET
14+
skip_cleanup: true
15+
on:
16+
tags: true
17+
deploy:
18+
provider: releases
19+
api_key: $GITHUB_API_KEY
20+
file:
21+
- "build/libs/gradle-file-encrypt-1.1.0.jar"
22+
- "build/libs/gradle-file-encrypt-1.1.0-javadoc.jar"
23+
- "build/libs/gradle-file-encrypt-1.1.0-sources.jar"
24+
skip_cleanup: true
25+
on:
26+
tags: true

build.gradle.kts

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,8 @@ plugins {
1919
id("com.gradle.plugin-publish") version "0.9.10"
2020
}
2121

22-
fun getHeadCommitSHA1Short(logger: Logger): String? {
23-
val gitDir = project.file(".git")
24-
if (!gitDir.exists() || !gitDir.isDirectory || !gitDir.canRead()) {
25-
logger.error(".git directory does not exist")
26-
return null
27-
}
28-
val headFile = File(gitDir, "HEAD")
29-
if (!headFile.exists() || !headFile.isFile || !headFile.canRead()) {
30-
logger.error("HEAD does not exist")
31-
return null
32-
}
33-
val headContent = headFile.readText(Charsets.UTF_8)
34-
if (headContent.contains(':')) {
35-
logger.warn("HEAD is branch")
36-
val refFile = File(gitDir, headContent.split(':')[1].trim())
37-
if (!refFile.exists() || !refFile.isFile || !refFile.canRead()) {
38-
logger.warn("Failed to find HEAD's branch")
39-
return null
40-
}
41-
return refFile.readText(Charsets.UTF_8).trim().take(7)
42-
} else {
43-
logger.warn("HEAD is single commit")
44-
return headContent.trim().take(7)
45-
}
46-
}
47-
48-
val currentCommit = getHeadCommitSHA1Short(logger)
49-
logger.warn("$currentCommit")
5022
group = "com.cherryperry.gfe"
51-
version = if (currentCommit != null) {
52-
"1.0.$currentCommit"
53-
} else {
54-
throw IllegalStateException("Failed to resolve commit based version")
55-
}
23+
version = "1.1.0"
5624

5725
configure<JavaPluginConvention> {
5826
sourceCompatibility = JavaVersion.VERSION_1_8

0 commit comments

Comments
 (0)