-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add signing support in publish command
Using both gpg and bouncycastle
- Loading branch information
1 parent
fa8298d
commit f99126d
Showing
27 changed files
with
2,019 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
modules/build/src/main/scala/scala/build/options/Secret.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package scala.build.options | ||
|
||
final class Secret[+T]( | ||
value0: T | ||
) { | ||
def value: T = value0 | ||
|
||
override def equals(obj: Any): Boolean = | ||
obj match { | ||
case other: Secret[_] => value == other.value | ||
case _ => false | ||
} | ||
|
||
// not leaking details about the secret here | ||
override def hashCode(): Int = 0 | ||
override def toString: String = "****" | ||
} | ||
|
||
object Secret { | ||
def apply[T](value: T): Secret[T] = | ||
new Secret(value) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
modules/cli/src/main/java/scala/cli/internal/BouncyCastleFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package scala.cli.internal; | ||
|
||
// from https://github.com/micronaut-projects/micronaut-oracle-cloud/pull/17 | ||
// see also https://github.com/oracle/graal/issues/2800#issuecomment-702480444 | ||
|
||
import com.oracle.svm.core.annotate.AutomaticFeature; | ||
import org.bouncycastle.jce.provider.BouncyCastleProvider; | ||
import org.graalvm.nativeimage.hosted.Feature; | ||
import org.graalvm.nativeimage.hosted.RuntimeClassInitialization; | ||
|
||
import java.security.Security; | ||
|
||
@AutomaticFeature | ||
public class BouncyCastleFeature implements Feature { | ||
|
||
@Override | ||
public void afterRegistration(AfterRegistrationAccess access) { | ||
RuntimeClassInitialization.initializeAtBuildTime("org.bouncycastle"); | ||
Security.addProvider(new BouncyCastleProvider()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.