-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from sbt/wip/back_publishing
Implement back publishing support
- Loading branch information
Showing
5 changed files
with
162 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ jobs: | |
java-version: 8 | ||
cache: sbt | ||
- uses: sbt/setup-sbt@v1 | ||
- run: sbt +compile | ||
- run: sbt +test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.geirsson | ||
|
||
import CiReleasePlugin.{ backPubVersionToCommand, dropBackPubCommand } | ||
|
||
class CiReleaseTest extends munit.FunSuite { | ||
val expectedVer = "1.1.0" | ||
|
||
test("Normal version default") { | ||
assertEquals(backPubVersionToCommand("1.1.0"), "+publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0"), expectedVer) | ||
} | ||
|
||
test("Command starting with number is assumed to be a cross version") { | ||
assertEquals(backPubVersionToCommand("1.1.0@2.12.20"), ";++2.12.20!;publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@2.12.20"), expectedVer) | ||
|
||
assertEquals(backPubVersionToCommand("1.1.0@3.x"), ";++3.x;publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@3.x"), expectedVer) | ||
} | ||
|
||
test("Non-number is treated as an alternative publish command") { | ||
assertEquals(backPubVersionToCommand("1.1.0@foo/publishSigned"), "foo/publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@foo/publishSigned"), expectedVer) | ||
|
||
assertEquals(backPubVersionToCommand("1.1.0@+foo/publishSigned"), "+foo/publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@+foo/publishSigned"), expectedVer) | ||
} | ||
|
||
test("Commands can be chained") { | ||
assertEquals(backPubVersionToCommand("1.1.0@2.12.20@foo/publishSigned"), ";++2.12.20!;foo/publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@2.12.20@foo/publishSigned"), expectedVer) | ||
|
||
assertEquals(backPubVersionToCommand("1.1.0@foo/something@bar/publishSigned"), ";foo/something;bar/publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@foo/something@bar/publishSigned"), expectedVer) | ||
} | ||
|
||
test("Treat # as comments") { | ||
assertEquals(backPubVersionToCommand("1.1.0#comment"), "+publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0#comment"), expectedVer) | ||
|
||
assertEquals(backPubVersionToCommand("1.1.0@2.12.20#comment"), ";++2.12.20!;publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@2.12.20#comment"), expectedVer) | ||
|
||
assertEquals(backPubVersionToCommand("1.1.0@3.x#comment"), ";++3.x;publishSigned") | ||
assertEquals(dropBackPubCommand("1.1.0@3.x#comment"), expectedVer) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters