Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
feat: version artifacts using git
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmcgee committed May 2, 2020
1 parent 6c37d70 commit 362fa39
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 35 deletions.
29 changes: 26 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.exflo.gradle.tasks.IntellijRunConfiguratorTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig
import me.qoomon.gradle.gitversioning.GitVersioningPluginConfig.*


plugins {
`maven-publish`
Expand All @@ -27,21 +30,42 @@ plugins {
id("com.github.johnrengelman.shadow") version "5.2.0" apply true
id("io.spring.dependency-management") version "1.0.9.RELEASE"
id("com.github.ben-manes.versions") version "0.27.0"
id("me.qoomon.git-versioning") version "3.0.0"
}

if (!JavaVersion.current().isJava11Compatible) {
throw GradleException("Java 11 or later is required to build Exflo. Detected version ${JavaVersion.current()}")
}

version = "0.0.0-SNAPSHOT"

gitVersioning.apply(closureOf<GitVersioningPluginConfig> {
branch(closureOf<VersionDescription>{
pattern = "master"
versionFormat = "\${version}"
})
branch(closureOf<VersionDescription>{
pattern = "feature/(?<feature>.+)"
versionFormat = "\${feature}-SNAPSHOT"
})
tag(closureOf<VersionDescription>{
pattern = "v(?<tagVersion>[0-9].*)"
versionFormat = "\${tagVersion}"
})
commit(closureOf<CommitVersionDescription>{
versionFormat = "\${commit.short}"
})
})

val distZip: Zip by project.tasks
distZip.apply {
dependsOn(":ingestion:kafka:build", ":ingestion:postgres:build")
dependsOn(":plugin:build")
doFirst { delete { fileTree(Pair("build/distributions", "*.zip")) } }
}

val distTar: Tar by project.tasks
distTar.apply {
dependsOn(":ingestion:kafka:build", ":ingestion:postgres:build")
dependsOn("plugin:build")
doFirst { delete { fileTree(Pair("build/distributions", "*.tar.gz")) } }
compression = Compression.GZIP
archiveExtension.set("tar.gz")
Expand All @@ -52,7 +76,6 @@ allprojects {
apply(from = "${rootDir}/gradle/versions.gradle")

group = "io.exflo"
version = rootProject.version

repositories {
mavenLocal()
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
# suppress inspection "UnusedProperty" for whole file
org.gradle.jvmargs=-Xmx1g
org.gradle.caching=true
org.gradle.parallel=true
version=0.1.0
org.gradle.parallel=true
30 changes: 0 additions & 30 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,6 @@ dependencies {
implementation(project(":ingestion:postgres"))
}

publishing {
publications {
create<MavenPublication>("mavenJava") {

groupId = "${rootProject.group}"
version = "${project.version}"

project.shadow.component(this)

pom {
name.set("Exflo - ${project.name}")
url.set("https://github.com/41North/exflo")

licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}

scm {
connection.set("scm:git:git://github.com/41North/exflo.git")
developerConnection.set("scm:git:ssh://github.com/41North/exflo.git")
url.set("https://github.com/41North/exflo")
}
}
}
}
}

val build: DefaultTask by project.tasks
build.dependsOn(tasks.shadowJar)

Expand Down

0 comments on commit 362fa39

Please sign in to comment.