Cask version fix (#18486)

* using artefact version in build

* using artefact version in build

* cask knows how to honour artifact versions
This commit is contained in:
Aaron Pritzlaff 2024-04-24 16:50:14 +01:00 committed by GitHub
parent 50945d0e17
commit efb7e5624d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 13 additions and 10 deletions

View File

@ -21,6 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|apiPackage|package for generated api classes| |null| |apiPackage|package for generated api classes| |null|
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null|
|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename. If not provided, uses the version from the OpenAPI specification file. If that's also not present, uses the default value of the artifactVersion option.| |null|
|dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8| |dateLibrary|Option. Date library to use|<dl><dt>**joda**</dt><dd>Joda (for legacy app)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (preferred for JDK 1.8+)</dd></dl>|java8|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|

View File

@ -118,6 +118,7 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code
cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.GROUP_ID, CodegenConstants.GROUP_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_ID, CodegenConstants.ARTIFACT_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.ARTIFACT_VERSION, CodegenConstants.ARTIFACT_VERSION_DESC));
cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.GIT_REPO_ID, CodegenConstants.GIT_REPO_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC)); cliOptions.add(new CliOption(CodegenConstants.GIT_USER_ID, CodegenConstants.GIT_USER_ID_DESC));
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, CodegenConstants.PACKAGE_DESCRIPTION)); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, CodegenConstants.PACKAGE_DESCRIPTION));
@ -158,6 +159,7 @@ public class ScalaCaskServerCodegen extends AbstractScalaCodegen implements Code
final String groupId = ensureProp(CodegenConstants.GROUP_ID, "org.openapitools"); final String groupId = ensureProp(CodegenConstants.GROUP_ID, "org.openapitools");
ensureProp(CodegenConstants.ARTIFACT_ID, "caskgen"); ensureProp(CodegenConstants.ARTIFACT_ID, "caskgen");
artifactVersion = ensureProp(CodegenConstants.ARTIFACT_VERSION, "0.0.1"); artifactVersion = ensureProp(CodegenConstants.ARTIFACT_VERSION, "0.0.1");
gitRepoId = ensureProp(CodegenConstants.GIT_REPO_ID, "<your git repo -- set 'gitRepoId'>"); gitRepoId = ensureProp(CodegenConstants.GIT_REPO_ID, "<your git repo -- set 'gitRepoId'>");
gitUserId = ensureProp(CodegenConstants.GIT_USER_ID, "<your git user -- set 'gitUserId'>"); gitUserId = ensureProp(CodegenConstants.GIT_USER_ID, "<your git user -- set 'gitUserId'>");

View File

@ -1,6 +1,6 @@
ThisBuild / name := "{{artifactId}}" ThisBuild / name := "{{artifactId}}"
ThisBuild / organization := "{{groupId}}" ThisBuild / organization := "{{groupId}}"
ThisBuild / version := "0.0.1-SNAPSHOT" ThisBuild / version := "{{artifactVersion}}"
ThisBuild / scalaVersion := "3.4.1" ThisBuild / scalaVersion := "3.4.1"
ThisBuild / scalafmtOnCompile := true ThisBuild / scalafmtOnCompile := true
ThisBuild / versionScheme := Some("early-semver") ThisBuild / versionScheme := Some("early-semver")

View File

@ -8,7 +8,7 @@ import mill._, scalalib._, scalafmt._, publish._
// mill _.publishLocal // mill _.publishLocal
// mill _.test.test // mill _.test.test
object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule { object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule {
def scalaVersion = "3.3.1" def scalaVersion = "3.4.1"
def pomSettings = PomSettings( def pomSettings = PomSettings(
description = "{{artifactId}}", description = "{{artifactId}}",
@ -21,7 +21,7 @@ object {{artifactId}} extends SbtModule with ScalafmtModule with PublishModule {
) )
) )
def publishVersion: mill.T[String] = T("0.0.1-SNAPSHOT") def publishVersion: mill.T[String] = T("{{artifactVersion}}")
def ivyDeps = Agg( def ivyDeps = Agg(
ivy"com.lihaoyi::cask:0.9.2" , ivy"com.lihaoyi::cask:0.9.2" ,

View File

@ -1,5 +1,5 @@
//> using scala "3.3.1" //> using scala "3.4.1"
//> using lib "{{groupId}}::{{artifactId}}:0.0.1-SNAPSHOT" //> using lib "{{groupId}}::{{artifactId}}:{{artifactVersion}}"
//> using repositories https://maven.pkg.github.com/{{{gitUserId}}}/{{{gitRepoId}}} //> using repositories https://maven.pkg.github.com/{{{gitUserId}}}/{{{gitRepoId}}}

View File

@ -1,6 +1,6 @@
ThisBuild / name := "scala-cask-petstore" ThisBuild / name := "scala-cask-petstore"
ThisBuild / organization := "cask.groupId" ThisBuild / organization := "cask.groupId"
ThisBuild / version := "0.0.1-SNAPSHOT" ThisBuild / version := "0.0.1"
ThisBuild / scalaVersion := "3.4.1" ThisBuild / scalaVersion := "3.4.1"
ThisBuild / scalafmtOnCompile := true ThisBuild / scalafmtOnCompile := true
ThisBuild / versionScheme := Some("early-semver") ThisBuild / versionScheme := Some("early-semver")

View File

@ -8,7 +8,7 @@ import mill._, scalalib._, scalafmt._, publish._
// mill _.publishLocal // mill _.publishLocal
// mill _.test.test // mill _.test.test
object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishModule { object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishModule {
def scalaVersion = "3.3.1" def scalaVersion = "3.4.1"
def pomSettings = PomSettings( def pomSettings = PomSettings(
description = "scala-cask-petstore", description = "scala-cask-petstore",
@ -21,7 +21,7 @@ object scala-cask-petstore extends SbtModule with ScalafmtModule with PublishMod
) )
) )
def publishVersion: mill.T[String] = T("0.0.1-SNAPSHOT") def publishVersion: mill.T[String] = T("0.0.1")
def ivyDeps = Agg( def ivyDeps = Agg(
ivy"com.lihaoyi::cask:0.9.2" , ivy"com.lihaoyi::cask:0.9.2" ,

View File

@ -1,5 +1,5 @@
//> using scala "3.3.1" //> using scala "3.4.1"
//> using lib "cask.groupId::scala-cask-petstore:0.0.1-SNAPSHOT" //> using lib "cask.groupId::scala-cask-petstore:0.0.1"
//> using repositories https://maven.pkg.github.com/GIT_USER_ID/GIT_REPO_ID //> using repositories https://maven.pkg.github.com/GIT_USER_ID/GIT_REPO_ID