@@ -9,6 +9,7 @@ homepage := Some(url("https://github.com/polystat/polystat-cli"))
99licenses := Seq (License .MIT )
1010organizationName := " Polystat"
1111organization := " org.polystat"
12+ name := " polystat-cli"
1213organizationHomepage := Some (url(" https://www.polystat.org/)" ))
1314developers := List (
1415 Developer (
@@ -19,7 +20,6 @@ developers := List(
1920 )
2021)
2122
22-
2323sonatypeProfileName := " org.polystat"
2424sonatypeCredentialHost := " s01.oss.sonatype.org"
2525scmInfo :=
@@ -118,6 +118,29 @@ scalacOptions ++= Seq(
118118 " -feature" ,
119119)
120120
121+ lazy val generateDescriptor =
122+ taskKey[Unit ](" Generate a descriptor that is used by coursier to install polystat-cli." )
123+
124+ generateDescriptor := {
125+ val ver = version.value
126+ val org = organization.value
127+ val artifactName = name.value
128+ val descriptor =
129+ s """ |{
130+ | "repositories": [
131+ | "ivy2Local",
132+ | "central"
133+ | ],
134+ | "dependencies": [
135+ | " ${org}: ${artifactName}_3: ${ver}"
136+ | ]
137+ |}
138+ | """ .stripMargin
139+ println(descriptor)
140+ java.nio.file.Files
141+ .write(java.nio.file.Paths .get(" coursier/polystat.json" ), descriptor.getBytes)
142+ }
143+
121144commands += Command .args(" preRelease" , " <arg>" ) { (state, args) =>
122145 args match {
123146 case Seq (nextVersion, pgpKeyId) =>
@@ -136,6 +159,7 @@ commands += Command.args("preRelease", "<arg>") { (state, args) =>
136159 tagRelease,
137160 releaseStepCommandAndRemaining(" publishSigned" ),
138161 releaseStepCommand(" sonatypeBundleRelease" ),
162+ releaseStepTask(generateDescriptor),
139163 pushChanges,
140164 ),
141165 usePgpKeyHex(pgpKeyId),
0 commit comments