Skip to content

Commit 918d0dd

Browse files
committed
Bootstrap repository for to be removed classess from core Scala Native project
1 parent 7dbe52b commit 918d0dd

39 files changed

+2725
-1
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
scalalib/src/
2+
scala-partest/fetchedSources/
3+
target/
4+
_build/
5+
*.dot
6+
*.ppm
7+
.idea
8+
scripts/.coursier
9+
scripts/.scalafmt*
10+
sbt-crossproject/
11+
local.sbt
12+
13+
CMakeLists.txt
14+
cmake-build-debug/
15+
16+
# Eclipse / Scala IDE
17+
bin/
18+
.project
19+
.classpath
20+
.settings/
21+
.externalToolBuilders/
22+
.cache*
23+
24+
# metals
25+
**/.bloop/
26+
/.metals/
27+
/project/**/metals.sbt
28+
29+
# Build Server Protocol, used by sbt
30+
/.bsp/
31+
32+
# vscode
33+
/.vscode/
34+
35+
# vim
36+
*.swp
37+
38+
# Virtual env generated dependecies, for generating docs
39+
.venv

.scalafmt.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version = "3.5.3"
2+
runner.dialect = scala213

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
# scala-native-java-stubs
1+
Scala Native implementation of Java stdlib components removed from the core Scala Native project.
2+
3+
## Usage:
4+
5+
```scala
6+
libraryDependencies += "org.scala-native" %%% "java-net-url" % "1.0.0"
7+
libraryDependencies += "org.scala-native" %%% "java-security" % "1.0.0"
8+
libraryDependencies += "org.scala-native" %%% "javax-security" % "1.0.0"
9+
```
10+
11+
## Modules
12+
### java-net-url
13+
Project providing stubs for `java.net.URI` and `java.net.URL` along with related classes, eg. `URLEncoder`
14+
15+
### java-security
16+
Project providing stubs for multiple interfaces from `java.net.security` and `java.net.security.cert` packages
17+
18+
### javax-security
19+
Project providing stubs `javax.net.security` package, contains currently only `java.security.auth.x500.X500Principal`
20+

build.sbt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
inThisBuild(
2+
Def.settings(
3+
version := "1.0.0",
4+
scalaVersion := "3.1.3",
5+
crossScalaVersions := Seq("2.12.16", "2.13.8", "3.1.3"),
6+
publishSettings,
7+
8+
versionScheme := Some("semver-spec")
9+
)
10+
)
11+
12+
lazy val javaNetUrl = project
13+
.withId("java-net-url")
14+
.in(file("java-net-url"))
15+
.enablePlugins(ScalaNativePlugin, ScalaNativeJUnitPlugin)
16+
.settings(withTestUtils)
17+
18+
lazy val javaSecurity = project
19+
.in(file("java-security"))
20+
.withId("java-security")
21+
.enablePlugins(ScalaNativePlugin, ScalaNativeJUnitPlugin)
22+
.settings(withTestUtils)
23+
24+
lazy val javaxSecurity = project
25+
.withId("javax-security")
26+
.in(file("javax-security"))
27+
.enablePlugins(ScalaNativePlugin)
28+
29+
// Internal utils for projects tests
30+
lazy val testUtils = project
31+
.in(file("test-utils"))
32+
.enablePlugins(ScalaNativePlugin, ScalaNativeJUnitPlugin)
33+
.settings(Compile / publishArtifact := false)
34+
35+
def withTestUtils = Def.settings(
36+
Test / unmanagedSourceDirectories += (testUtils / sourceDirectory).value
37+
)
38+
39+
def publishSettings = Def.settings(
40+
organization := "org.scala-native",
41+
// name := id,
42+
homepage := Some(url("https://www.scala-native.org")),
43+
startYear := Some(2022),
44+
licenses := Seq(
45+
"BSD-like" -> url("https://www.scala-lang.org/downloads/license.html")
46+
),
47+
developers += Developer(
48+
email = "wmazur@virtuslab.com",
49+
id = "wojciechmazur",
50+
name = "Wojciech Mazur",
51+
url = url("https://github.com/WojciechMazur")
52+
),
53+
scmInfo := Some(
54+
ScmInfo(
55+
browseUrl =
56+
url("https://github.com/scala-native/scala-native-java-stubs"),
57+
connection =
58+
"scm:git:git@github.com:scala-native/scala-native-java-stubs.git"
59+
)
60+
),
61+
Compile / publishArtifact := true,
62+
Test / publishArtifact := false,
63+
publishMavenStyle := true,
64+
pomIncludeRepository := (_ => false),
65+
isSnapshot := version.value.contains("SNAPSHOT"),
66+
publishTo := {
67+
val nexus = "https://oss.sonatype.org/"
68+
if (isSnapshot.value)
69+
Some("snapshots" at nexus + "content/repositories/snapshots")
70+
else
71+
Some("releases" at nexus + "service/local/staging/deploy/maven2")
72+
},
73+
credentials ++= {
74+
for {
75+
realm <- sys.env.get("MAVEN_REALM")
76+
domain <- sys.env.get("MAVEN_DOMAIN")
77+
user <- sys.env.get("MAVEN_USER")
78+
password <- sys.env.get("MAVEN_PASSWORD")
79+
} yield Credentials(realm, domain, user, password)
80+
}.toSeq
81+
)

0 commit comments

Comments
 (0)