config package

This commit is contained in:
2020-03-25 15:26:19 +01:00
parent a6d2a4d34f
commit fc4fde490f
7 changed files with 35 additions and 19 deletions

1
.idea/.name generated
View File

@@ -1 +0,0 @@
postgresjson

5
.idea/misc.xml generated
View File

@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="adopt-openjdk-11" project-jdk-type="JavaSDK"> <component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="adopt-openjdk-11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="TaskProjectConfiguration"> <component name="TaskProjectConfiguration">

View File

@@ -1,6 +1,3 @@
group = "fr.postgresjson"
version = "0.1"
plugins { plugins {
jacoco jacoco
@@ -9,8 +6,12 @@ plugins {
id("org.jlleitschuh.gradle.ktlint") version "8.2.0" id("org.jlleitschuh.gradle.ktlint") version "8.2.0"
id("org.owasp.dependencycheck") version "5.1.0" id("org.owasp.dependencycheck") version "5.1.0"
id("fr.coppernic.versioning") version "3.1.2"
} }
group = "flecomte"
version = versioning.info.tag
repositories { repositories {
mavenCentral() mavenCentral()
jcenter() jcenter()
@@ -31,14 +32,27 @@ dependencies {
testImplementation("org.amshove.kluent:kluent:1.47") testImplementation("org.amshove.kluent:kluent:1.47")
} }
publishing { val sourcesJar by tasks.creating(Jar::class) {
publications { archiveClassifier.set("sources")
create<MavenPublication>("maven") { from(sourceSets.getByName("main").allSource)
groupId = "fr.postgresjson" }
artifactId = "postgresjson"
version = "0.1"
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<MavenPublication>("postgres-json") {
from(components["java"]) from(components["java"])
artifact(sourcesJar)
} }
} }
} }

View File

@@ -1,5 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

View File

@@ -1 +1 @@
rootProject.name = 'postgresjson' rootProject.name = 'postgres-json'

View File

@@ -5,7 +5,7 @@ import fr.postgresjson.connexion.Connection
import fr.postgresjson.migration.Migration.Action import fr.postgresjson.migration.Migration.Action
import fr.postgresjson.migration.Migration.Status import fr.postgresjson.migration.Migration.Status
import java.util.* import java.util.*
import java.util.concurrent.CompletionException import java.util.concurrent.*
import fr.postgresjson.definition.Function as DefinitionFunction import fr.postgresjson.definition.Function as DefinitionFunction
data class Function( data class Function(
@@ -75,7 +75,7 @@ data class Function(
} }
override fun status(): Status { override fun status(): Status {
val result = connection.inTransaction { connection.inTransaction {
up() up()
down() down()
it.sendQuery("ROLLBACK") it.sendQuery("ROLLBACK")

View File

@@ -48,7 +48,7 @@ data class Query(
} }
override fun status(): Migration.Status { override fun status(): Migration.Status {
val result = connection.inTransaction { connection.inTransaction {
up() up()
down() down()
it.sendQuery("ROLLBACK") it.sendQuery("ROLLBACK")