diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 1506d0b..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -postgresjson \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 039c28f..bcb1a91 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,9 @@ - + + + + diff --git a/build.gradle.kts b/build.gradle.kts index 8ab350b..6faf971 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,3 @@ -group = "fr.postgresjson" -version = "0.1" - plugins { jacoco @@ -9,8 +6,12 @@ plugins { id("org.jlleitschuh.gradle.ktlint") version "8.2.0" id("org.owasp.dependencycheck") version "5.1.0" + id("fr.coppernic.versioning") version "3.1.2" } +group = "flecomte" +version = versioning.info.tag + repositories { mavenCentral() jcenter() @@ -31,14 +32,27 @@ dependencies { testImplementation("org.amshove.kluent:kluent:1.47") } -publishing { - publications { - create("maven") { - groupId = "fr.postgresjson" - artifactId = "postgresjson" - version = "0.1" +val sourcesJar by tasks.creating(Jar::class) { + archiveClassifier.set("sources") + from(sourceSets.getByName("main").allSource) +} - from(components["java"]) +publishing { + repositories { + maven { + name = "postgres-json" + url = uri("https://maven.pkg.github.com/flecomte/postgres-json") + credentials { + username = System.getenv("GITHUB_USERNAME") + password = System.getenv("GITHUB_TOKEN") + } } } -} + + publications { + create("postgres-json") { + from(components["java"]) + artifact(sourcesJar) + } + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7c4388a..8eaecef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index db2087e..a2b6f5d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = 'postgresjson' +rootProject.name = 'postgres-json' diff --git a/src/main/kotlin/fr/postgresjson/migration/Function.kt b/src/main/kotlin/fr/postgresjson/migration/Function.kt index 24b828e..4ed2e38 100644 --- a/src/main/kotlin/fr/postgresjson/migration/Function.kt +++ b/src/main/kotlin/fr/postgresjson/migration/Function.kt @@ -5,7 +5,7 @@ import fr.postgresjson.connexion.Connection import fr.postgresjson.migration.Migration.Action import fr.postgresjson.migration.Migration.Status import java.util.* -import java.util.concurrent.CompletionException +import java.util.concurrent.* import fr.postgresjson.definition.Function as DefinitionFunction data class Function( @@ -75,7 +75,7 @@ data class Function( } override fun status(): Status { - val result = connection.inTransaction { + connection.inTransaction { up() down() it.sendQuery("ROLLBACK") diff --git a/src/main/kotlin/fr/postgresjson/migration/Query.kt b/src/main/kotlin/fr/postgresjson/migration/Query.kt index ef43c88..4d571a8 100644 --- a/src/main/kotlin/fr/postgresjson/migration/Query.kt +++ b/src/main/kotlin/fr/postgresjson/migration/Query.kt @@ -48,7 +48,7 @@ data class Query( } override fun status(): Migration.Status { - val result = connection.inTransaction { + connection.inTransaction { up() down() it.sendQuery("ROLLBACK")