Skip to content

Commit

Permalink
Add remaining delegation need for Scala.js stubs (#97)
Browse files Browse the repository at this point in the history
* Add remaining delegation need for Scala.js stubs

* Update build and readme for release
  • Loading branch information
ekrich committed Sep 14, 2020
1 parent d3e8783 commit 67b90c0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ target/
# metals
.bloop/
.metals/
project/metals.sbt
/project/**/metals.sbt

# vscode
/.vscode/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ For specific changes, refer to the releases below.

## Versions

Release [1.3.3](https://github.com/ekrich/sconfig/releases/tag/v1.3.3) - (2020-09-14)<br/>
Release [1.3.2](https://github.com/ekrich/sconfig/releases/tag/v1.3.2) - (2020-09-01)<br/>
Release [1.3.1](https://github.com/ekrich/sconfig/releases/tag/v1.3.1) - (2020-07-24)<br/>
Release [1.3.0](https://github.com/ekrich/sconfig/releases/tag/v1.3.0) - (2020-05-01)<br/>
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ addCommandAlias(
).mkString(";", ";", "")
)

val prevVersion = "1.3.0"
val nextVersion = "1.3.1"
val prevVersion = "1.3.3"
val nextVersion = "1.3.4"

// stable snapshot is not great for publish local
def versionFmt(out: sbtdynver.GitDescribeOutput): String = {
Expand Down
11 changes: 11 additions & 0 deletions sconfig/js/src/main/scala/PlatformClassLoader.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.ekrich.config.impl

import java.net.URL
import java.{util => ju}

/**
* To workaround missing implementation in Scala.js
*/
class PlatformClassLoader(cl: ClassLoader) extends ClassLoaderLike {
def getResources(name: String): ju.Enumeration[URL] = ???
}
8 changes: 0 additions & 8 deletions sconfig/js/src/main/scala/java/lang/ClassLoader.scala

This file was deleted.

11 changes: 11 additions & 0 deletions sconfig/shared/src/main/scala/ClassLoaderLike.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.ekrich.config.impl

import java.net.URL
import java.{util => ju}

/**
* To workaround missing implementation in Scala.js
*/
trait ClassLoaderLike {
def getResources(name: String): ju.Enumeration[URL]
}
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ object Parseable {
throw new ConfigException.BugOrBroken(
"null class loader; pass in a class loader or use Thread.currentThread().setContextClassLoader()"
)
val e = loader.getResources(resource)
val e = new PlatformClassLoader(loader).getResources(resource)
if (!e.hasMoreElements) {
if (ConfigImpl.traceLoadsEnabled)
trace(
Expand Down
11 changes: 11 additions & 0 deletions sconfig/sharedjvmnative/src/main/scala/PlatformClassLoader.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.ekrich.config.impl

import java.net.URL
import java.{util => ju}

/**
* To workaround missing implementation in Scala.js
*/
class PlatformClassLoader(cl: ClassLoader) extends ClassLoaderLike {
def getResources(name: String): ju.Enumeration[URL] = cl.getResources(name)
}

0 comments on commit 67b90c0

Please sign in to comment.