small refactoring

This commit is contained in:
InsanusMokrassar 2020-09-22 18:12:48 +06:00
parent 8b5244d8df
commit 8804a24013
1 changed files with 4 additions and 21 deletions

View File

@ -19,15 +19,6 @@ plugins {
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" apply false id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" apply false
} }
ext {
enable_github_publish=new File(projectDir, "secret.gradle").exists()
}
if (ext.enable_github_publish) {
apply from: './secret.gradle'
apply plugin: "com.github.breadmoirai.github-release"
}
private String getCurrentVersionChangelog() { private String getCurrentVersionChangelog() {
OutputStream changelogDataOS = new ByteArrayOutputStream() OutputStream changelogDataOS = new ByteArrayOutputStream()
exec { exec {
@ -38,8 +29,10 @@ private String getCurrentVersionChangelog() {
return changelogDataOS.toString().trim() return changelogDataOS.toString().trim()
} }
if (enable_github_publish && project.hasProperty('GITHUB_RELEASE_TOKEN')) { if (new File(projectDir, "secret.gradle").exists()) {
String changelogFromFile = "" apply from: './secret.gradle'
apply plugin: "com.github.breadmoirai.github-release"
githubRelease { githubRelease {
token "${project.property('GITHUB_RELEASE_TOKEN')}" token "${project.property('GITHUB_RELEASE_TOKEN')}"
@ -52,14 +45,4 @@ if (enable_github_publish && project.hasProperty('GITHUB_RELEASE_TOKEN')) {
body getCurrentVersionChangelog() body getCurrentVersionChangelog()
} }
// tasks.getByName("githubRelease").doFirst {
// OutputStream changelogDataOS = new ByteArrayOutputStream()
// exec {
// standardOutput = changelogDataOS
// commandLine './changelog_info_retriever', "$library_version", 'CHANGELOG.md'
// }
// changelogFromFile = changelogDataOS.toString().trim()
// ext.changelog_from_file = changelogFromFile
// }
} }