You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// So that publishLocal doesn't continuously create new versionsdefversionFmt(out: sbtdynver.GitDescribeOutput):String= {
valsnapshotSuffix=if
(out.isSnapshot()) "-SNAPSHOT"else""
out.ref.dropPrefix + snapshotSuffix
}
deffallbackVersion(d: java.util.Date):String=s"HEAD-${sbtdynver.DynVer timestamp d}"ThisBuild/ version := dynverGitDescribeOutput.value.mkVersion(versionFmt, fallbackVersion(dynverCurrentDate.value))
ThisBuild/ dynver := {
vald=new java.util.Date
sbtdynver.DynVer.getGitDescribeOutput(d).mkVersion(versionFmt, fallbackVersion(d))
}
The code basically means that you get basic snapshots (i.e. v1.0.0-SNAPSHOT) without any hashing/commit'ids/etc etc. The reason why this is useful is specifically for SBT plugins that have scripted tests which require local publishing (see discussion at sbt/sbt-osgi#88 (review)). Without this change, every single invocation of a scripted test that slightly changes the contents to make the state dirty ends up creating a new publishLocal which can quickly fill up local cache (and this is standard flow for working on sbt plugins).
One question is how this should be implemented, i.e. should we just add versionFmt/fallbackVersion as constants into sbt-dynver so that end users can just go
Or should we instead do something more comprehensive, i.e. some ADT that has predefined "patterns"
sealedabstracttraitVersionPatternobjectVersionPattern {
caseobjectDefaultextendsVersionPattern// current implementationcaseobjectSimpleextendsVersionPattern// whats being suggested in this PRfinalcaseclassCustom(versionFmt: sbtdynver.GitDescribeOutput=>String, fallbackVersion: java.util.Date=>String)
}
The text was updated successfully, but these errors were encountered:
In both sbt-osgi and sbt-github-actions we have the following code
The code basically means that you get basic snapshots (i.e.
v1.0.0-SNAPSHOT
) without any hashing/commit'ids/etc etc. The reason why this is useful is specifically for SBT plugins that have scripted tests which require local publishing (see discussion at sbt/sbt-osgi#88 (review)). Without this change, every single invocation of a scripted test that slightly changes the contents to make the state dirty ends up creating a newpublishLocal
which can quickly fill up local cache (and this is standard flow for working on sbt plugins).One question is how this should be implemented, i.e. should we just add
versionFmt
/fallbackVersion
as constants into sbt-dynver so that end users can just goOr should we instead do something more comprehensive, i.e. some ADT that has predefined "patterns"
The text was updated successfully, but these errors were encountered: