From 677f6e1c878434ebc492e5b4b539aa7cd867fb37 Mon Sep 17 00:00:00 2001 From: pjaffe Date: Mon, 19 Apr 2021 16:29:02 -0700 Subject: [PATCH 1/6] configure to publish to artifactory --- build.sbt | 12 +++++++++--- project/build.properties | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 4635c5f..77ee688 100644 --- a/build.sbt +++ b/build.sbt @@ -20,9 +20,15 @@ startYear in ThisBuild := Some(2018) description in ThisBuild := "A library for working with standards from the EPC extension to the GS1 standard" crossPaths in ThisBuild := false -bintrayOrganization in ThisBuild := Some("nike") -bintrayRepository in ThisBuild := "maven" -bintrayPackage in ThisBuild := "epc-standards" +publishTo in ThisBuild := { + val repo = "https://artifactory.nike.com/artifactory/maven" + if (isSnapshot.value) { + Some("snapshots" at s"$repo-snapshots") + } else { + Some("releases" at repo) + } +} +credentials in ThisBuild += Credentials(Path.userHome / ".ivy2" / ".credentials") version in ThisBuild := sys.env.get("TRAVIS_TAG").filter(_.trim.nonEmpty).getOrElse("0-SNAPSHOT") diff --git a/project/build.properties b/project/build.properties index 7c58a83..0b2e09c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.6 +sbt.version=1.4.7 From 9d5b83758c0ba0ee6a8761e66954c7c66d5a46e6 Mon Sep 17 00:00:00 2001 From: pjaffe Date: Wed, 21 Apr 2021 13:56:30 -0700 Subject: [PATCH 2/6] adjust default versioning --- README.md | 9 +++++---- build.sbt | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cd2344c..5518434 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Currently only SGTIN-96 and a custom Nike display tag format (XNDT) are supporte ### SBT ``` scala -resolvers in ThisBuild += "oss-nike" at "https://dl.bintray.com/nike/maven" +resolvers in ThisBuild += "nike-oss" at "https://artifactory.nike.com/artifactory/maven" libraryDependencies += "com.nike.epc" % "epc-core" % "1.0.0" ``` @@ -31,11 +31,11 @@ libraryDependencies += "com.nike.epc" % "epc-core" % "1.0.0" ``` groovy repositories { maven { - url 'https://dl.bintray.com/nike/maven' + url 'https://artifactory.nike.com/artifactory/maven' } } -compile group: 'com.nike.epc', name: 'epc-core', version: '1.0.0' +compile group: 'com.nike.epc', name: 'epc-core', version: '1.0.0', ext: 'pom' ``` ### Maven @@ -44,13 +44,14 @@ compile group: 'com.nike.epc', name: 'epc-core', version: '1.0.0' nike-oss Nike OSS - https://dl.bintray.com/nike/maven + https://artifactory.nike.com/artifactory/maven com.nike.epc epc-core 1.0.0 + pom ``` diff --git a/build.sbt b/build.sbt index 77ee688..e5698a6 100644 --- a/build.sbt +++ b/build.sbt @@ -20,6 +20,8 @@ startYear in ThisBuild := Some(2018) description in ThisBuild := "A library for working with standards from the EPC extension to the GS1 standard" crossPaths in ThisBuild := false +version in ThisBuild := sys.env.get("TRAVIS_TAG").filter(_.trim.nonEmpty).getOrElse("0-DO-NOT-PUBLISH") + publishTo in ThisBuild := { val repo = "https://artifactory.nike.com/artifactory/maven" if (isSnapshot.value) { @@ -30,14 +32,12 @@ publishTo in ThisBuild := { } credentials in ThisBuild += Credentials(Path.userHome / ".ivy2" / ".credentials") -version in ThisBuild := sys.env.get("TRAVIS_TAG").filter(_.trim.nonEmpty).getOrElse("0-SNAPSHOT") - lazy val ci = TaskKey[Unit]("ci") lazy val `epc-standards` = (project in file(".")) .settings( ci := Def.taskDyn { - if (version.value.endsWith("-SNAPSHOT")) { + if (version.value.endsWith("-DO-NOT-PUBLISH")) { Def.task { (`epc-core` / (jacoco in Test)).value } From 7867f28d05fc1c180a34a219be81288b9f2a9170 Mon Sep 17 00:00:00 2001 From: pjaffe Date: Wed, 21 Apr 2021 16:10:41 -0700 Subject: [PATCH 3/6] move to sbt release for publishing --- build.sbt | 13 +++---------- project/plugins.sbt | 4 ++-- version.sbt | 1 + 3 files changed, 6 insertions(+), 12 deletions(-) create mode 100644 version.sbt diff --git a/build.sbt b/build.sbt index e5698a6..0a63c83 100644 --- a/build.sbt +++ b/build.sbt @@ -20,8 +20,6 @@ startYear in ThisBuild := Some(2018) description in ThisBuild := "A library for working with standards from the EPC extension to the GS1 standard" crossPaths in ThisBuild := false -version in ThisBuild := sys.env.get("TRAVIS_TAG").filter(_.trim.nonEmpty).getOrElse("0-DO-NOT-PUBLISH") - publishTo in ThisBuild := { val repo = "https://artifactory.nike.com/artifactory/maven" if (isSnapshot.value) { @@ -36,15 +34,10 @@ lazy val ci = TaskKey[Unit]("ci") lazy val `epc-standards` = (project in file(".")) .settings( + publishArtifact := false, ci := Def.taskDyn { - if (version.value.endsWith("-DO-NOT-PUBLISH")) { - Def.task { - (`epc-core` / (jacoco in Test)).value - } - } else { - Def.task { - (`epc-core` / publish).dependsOn((`epc-core` / (jacoco in Test))).value - } + Def.task { + (`epc-core` / publish).dependsOn((`epc-core` / (jacoco in Test))).value } }.value ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 887ef85..87ab690 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ resolvers += Resolver.jcenterRepo -addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.0.3") +addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.3.0") +addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15") addSbtPlugin("net.aichler" % "sbt-jupiter-interface" % "0.7.0") addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.4.1") -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") diff --git a/version.sbt b/version.sbt new file mode 100644 index 0000000..d805952 --- /dev/null +++ b/version.sbt @@ -0,0 +1 @@ +version in ThisBuild := "1.0.1a-SNAPSHOT" \ No newline at end of file From 8df819aacbe5b7c932eb8305ed1c51fa7fa4e6c8 Mon Sep 17 00:00:00 2001 From: pjaffe Date: Wed, 21 Apr 2021 17:15:22 -0700 Subject: [PATCH 4/6] ignore generated bsp file --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ad1141e..b67986d 100644 --- a/.gitignore +++ b/.gitignore @@ -168,5 +168,7 @@ Session.vim tags # End of https://www.gitignore.io/api/git,vim,macos,emacs,intellij+all +.bsp/sbt.json + target/ **/target/ \ No newline at end of file From 07131f3a77ffe455e669ffce576c1d6ecbbcda98 Mon Sep 17 00:00:00 2001 From: pjaffe Date: Wed, 21 Apr 2021 17:16:04 -0700 Subject: [PATCH 5/6] Setting version to 1.0.1a-SNAPSHOT --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index d805952..ffbdd8d 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "1.0.1a-SNAPSHOT" \ No newline at end of file +ThisBuild / version := "1.0.1a-SNAPSHOT" From cffb8e9905f02bbe9be320ae3587d912458d7f01 Mon Sep 17 00:00:00 2001 From: pjaffe Date: Wed, 21 Apr 2021 17:16:10 -0700 Subject: [PATCH 6/6] Setting version to 1.0.2-SNAPSHOT --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index ffbdd8d..2d362f1 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -ThisBuild / version := "1.0.1a-SNAPSHOT" +ThisBuild / version := "1.0.2-SNAPSHOT"