@@ -24,58 +24,67 @@ lazy val scalapyVersion = getProp("plugin.scalapy.version").getOrElse("0.5.2")
2424
2525lazy val enableScripted = getProp(" plugin.ci" ).isDefined
2626
27- ThisBuild / scalaVersion := ( if (enableScripted) scala212 else scala213)
27+ ThisBuild / scalaVersion := scala213
2828
2929ThisBuild / scalafixDependencies += organizeImports
3030
31- def warnUnusedImports (scalaVersion : String ) =
32- CrossVersion .partialVersion(scalaVersion) match {
33- case Some ((2 , _)) => Seq (" -Xlint:unused" )
34- case _ => Nil
35- }
36-
3731def getProp (p : String ) = Option (sys.props(p)).map(_.trim).filter(_.nonEmpty)
3832
3933def getProps (prop : String * ) =
4034 prop
4135 .map(p => p -> getProp(p))
4236 .collect { case (k, Some (v)) => s """ -D $k= $v""" }
4337
44- def scriptedPlugin = if (enableScripted) Seq (ScriptedPlugin ) else Nil
38+ lazy val publishSettings = Seq (
39+ sonatypeCredentialHost := " s01.oss.sonatype.org" ,
40+ sonatypeRepository := " https://s01.oss.sonatype.org/service/local"
41+ )
4542
46- def scriptedSettings = if (enableScripted) {
47- Seq (
48- scriptedLaunchOpts := {
49- scriptedLaunchOpts.value ++ {
50- Seq (s " -Dplugin.scalapy.version= $scalapyVersion" ) ++
51- getProps(" plugin.python.executable" , " plugin.virtualenv" ) ++
52- Seq (" -Xmx1024M" , " -Dplugin.version=" + version.value)
53- }
54- },
55- scriptedBufferLog := false
56- )
57- } else Nil
43+ lazy val noPublishSettings = Seq (
44+ publishArtifact := false ,
45+ packagedArtifacts := Map .empty,
46+ publish := {},
47+ publishLocal := {}
48+ )
5849
59- lazy val root = ( project in file( " . " ))
60- .enablePlugins( scriptedPlugin : _* )
50+ lazy val `python-native-libs` = project
51+ .in(file( " python-native-libs " ) )
6152 .settings(
6253 name := " Python Native Libs" ,
6354 crossScalaVersions := Seq (scala212, scala213, scala3),
6455 libraryDependencies += scalaCollectionCompat,
65- sonatypeCredentialHost := " s01.oss.sonatype.org" ,
66- sonatypeRepository := " https://s01.oss.sonatype.org/service/local" ,
67- semanticdbEnabled := true ,
68- semanticdbVersion := scalafixSemanticdb.revision,
69- scalacOptions ++= warnUnusedImports(scalaVersion.value)
56+ semanticdbEnabled := true ,
57+ semanticdbVersion := scalafixSemanticdb.revision,
58+ scalacOptions += {
59+ CrossVersion .partialVersion(scalaVersion.value) match {
60+ case Some ((2 , 13 )) => " -Wunused:imports"
61+ case Some ((2 , 12 )) => " -Ywarn-unused-import"
62+ case _ => " "
63+ }
64+ }
7065 )
71- .settings(scriptedSettings)
66+ .settings(publishSettings)
67+
68+ lazy val tests = project
69+ .in(file(" tests" ))
70+ .enablePlugins(ScriptedPlugin )
71+ .settings(
72+ scalaVersion := scala212,
73+ scriptedLaunchOpts ++= {
74+ Seq (s " -Dplugin.scalapy.version= $scalapyVersion" ) ++
75+ getProps(" plugin.python.executable" , " plugin.virtualenv" ) ++
76+ Seq (" -Xmx1024M" , " -Dplugin.version=" + (`python-native-libs` / version).value)
77+ },
78+ scriptedBufferLog := false
79+ )
80+ .settings(noPublishSettings)
7281
7382lazy val docs = project
7483 .in(file(" python-docs" ))
84+ .enablePlugins(MdocPlugin )
7585 .settings(
7686 mdocVariables := Map (
7787 " PYTHON" -> " /usr/bin/python3"
7888 )
7989 )
80- .dependsOn(root)
81- .enablePlugins(MdocPlugin )
90+ .dependsOn(`python-native-libs`)
0 commit comments