-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add library3.properties #24332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add library3.properties #24332
Conversation
|
|
||
| // If available in the same jar as the stdlib classes, overlay Scala 3 | ||
| // runtime properties contained in `library3.properties` (e.g., version.number). | ||
| val lib3Stream = pickJarBasedOn.getResourceAsStream(lib3Filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming we're searching for properties based on classpath of Option[?] since 3.8 we're probably never going to find /library.properties, so it seems like we might just start to emit it directly without a fallback.
project/Build.scala
Outdated
| s"""version.number=${version.value} | ||
| |maven.version.number=${version.value} | ||
| |""".stripMargin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scala 2.13 library.properties content:
copyright.string=Copyright 2002-2025, LAMP/EPFL and Lightbend, Inc. dba Akka
maven.version.number=2.13.17
osgi.version.number=2.13.17.v20250930-055830-VFINAL-05169c7
shell.banner=%n ________ ___ / / ___%n / __/ __// _ | / / / _ |%n __\\ \\/ /__/ __ |/ /__/ __ |%n /____/\\___/_/ |_/____/_/ | |%n |/ %s
version.number=2.13.17
We might consider emitting these as well (maybe with exception of osgi.version.number) and updated copyright
Also seems like a good case to refactor to common task/function due to duplicates of code
| lazy val generateLibrary3Properties: Def.Initialize[Task[Seq[File]]] = generatePropertiesFile( | ||
| contents = s"""version.number=${version.value} | ||
| |maven.version.number=${version.value} | ||
| |copyright.string=Copyright 2002-$currentYear, LAMP/EPFL and Lightbend, Inc. dba Akka |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be only LAMP/EPFL according to compiler.properties from scala3-compiler jar
project/Build.scala
Outdated
| contents = s"""version.number=${version.value} | ||
| |maven.version.number=${version.value} | ||
| |copyright.string=Copyright 2002-$currentYear, LAMP/EPFL and Lightbend, Inc. dba Akka | ||
| |shell.banner=%n ________ ___ / / ___%n / __/ __// _ | / / / _ |%n __\\ \\/ /__/ __ |/ /__/ __ |%n /____/\\___/_/ |_/____/_/ | |%n |/ %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentatially we could move it variable and interpolate so that it's readable for us
|
It's been a while since I used the old shell banner, but when I did, it inspired me with community spirit! |
| @@ -0,0 +1,7 @@ | |||
| object Test { | |||
| def main(args: Array[String]): Unit = { | |||
| val v = scala.util.Properties.versionNumberString | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add 1 more test when using scala3-compiler artifact, whcih contains support for detecting Scala version of compiler? It would be useful for me, as I need to detect version of compiler in compiler plugin, see https://github.com/scala-native/scala-native/blob/6ddaf5554a0ea5fdcacfced34bea36856f4c58f2/nscplugin/src/main/scala-3/scala/scalanative/nscplugin/AdaptLazyVals.scala#L27-L31
0322a9b to
4a17857
Compare
Fixes #22144