1- val ScalaNativeVersion = " 0.5.9-SNAPSHOT"
1+ import scala .scalanative .nir .Proxy .nativeBinaryVersion
2+
23
34val crossScalaVersions212 = (14 to 20 ).map(" 2.12." + _)
45val crossScalaVersions213 = (8 to 16 ).map(" 2.13." + _)
@@ -100,9 +101,6 @@ inThisBuild(
100101 Some (
" scm:git:[email protected] :scala-native/scala-native-cli.git" )
101102 )
102103 ),
103- // Used during the releases
104- resolvers += " Sonatype Central Deployments" at " https://central.sonatype.com/api/v1/publisher/deployments/download/" ,
105- resolvers ++= Resolver .sonatypeOssRepos(" snapshots" ),
106104 resolvers += Resolver .sonatypeCentralSnapshots,
107105 resolvers += Resolver .mavenCentral,
108106 resolvers += Resolver .defaultLocal
@@ -120,11 +118,10 @@ lazy val cli = project
120118 crossScalaVersions := publishScalaVersions,
121119 Compile / run / mainClass :=
122120 Some (" scala.scalanative.cli.ScalaNativeLd" ),
123- scalacOptions += " -Ywarn-unused:imports" ,
124- scalacOptions ++= CrossVersion .partialVersion(scalaVersion.value).collect {
125- case (2 , _) => " -target:jvm-1.8"
126- case (3 , _) => " -Xtarget:8"
127- },
121+ scalacOptions ++= Seq (
122+ " -release:8" ,
123+ " -Ywarn-unused:imports"
124+ ),
128125 libraryDependencies ++= Seq (
129126 " org.scala-native" %% " tools" % scalaNativeVersion.value,
130127 " com.github.scopt" %% " scopt" % " 4.0.1" ,
@@ -170,13 +167,6 @@ lazy val cliScriptedTests = project
170167 }
171168 )
172169
173- def nativeBinaryVersion (version : String ): String = {
174- val VersionPattern = raw " (\d+)\.(\d+)\.(\d+)(\-.*)? " .r
175- val VersionPattern (major, minor, patch, milestone) = version
176- if (patch != null && milestone != null ) version
177- else s " $major. $minor"
178- }
179-
180170val nativeSourceExtensions = Set (" .c" , " .cpp" , " .cxx" , " .h" , " .hpp" , " .S" )
181171val DeduplicateOrRename = new sbtassembly.MergeStrategy {
182172 def name : String = " deduplicate-or-rename"
@@ -230,7 +220,7 @@ lazy val cliPackSettings = Def.settings(
230220 val lm = {
231221 import sbt .librarymanagement .ivy ._
232222 val ivyConfig = InlineIvyConfiguration ()
233- .withResolvers(resolvers.value.toVector)
223+ .withResolvers(( ThisBuild / resolvers) .value.toVector)
234224 .withLog(log)
235225 IvyDependencyResolution (ivyConfig)
236226 }
@@ -312,9 +302,7 @@ lazy val sonatypePublishSettings = Def.settings(
312302 publishMavenStyle := true ,
313303 pomIncludeRepository := (_ => false ),
314304 publishTo := {
315- val centralSnapshots =
316- " https://central.sonatype.com/repository/maven-snapshots/"
317- if (isSnapshot.value) Some (" central-snapshots" at centralSnapshots)
305+ if (isSnapshot.value) Some (Resolver .sonatypeCentralSnapshots)
318306 else localStaging.value
319307 },
320308 credentials ++= {
0 commit comments