-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from alexarchambault/develop
Add bootstrap / lmcoursier / coursierapi modules
- Loading branch information
Showing
32 changed files
with
658 additions
and
161 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
46 changes: 46 additions & 0 deletions
46
...s-jni-utils-bootstrap/src/main/java/coursier/bootstrap/launcher/jniutils/NativeCalls.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,46 @@ | ||
package coursier.bootstrap.launcher.jniutils; | ||
|
||
import coursier.jniutils.LoadWindowsLibrary; | ||
import coursier.jniutils.NativeApi; | ||
|
||
public final class NativeCalls { | ||
|
||
static native String terminalSizeNative(); | ||
|
||
static native String enableAnsiOutputNative(); | ||
|
||
static native byte[] GetUserEnvironmentVariableNative(byte[] key); | ||
static native byte[] SetUserEnvironmentVariableNative(byte[] key, byte[] value); | ||
static native byte[] DeleteUserEnvironmentVariableNative(byte[] key); | ||
|
||
static native String GetKnownFolderPathNative(String rfid); | ||
|
||
|
||
public static void setup() { | ||
LoadWindowsLibrary.ensureInitialized(); | ||
NativeApi nativeApi = new NativeApi() { | ||
public String terminalSize() { | ||
return terminalSizeNative(); | ||
} | ||
|
||
public String enableAnsiOutput() { | ||
return enableAnsiOutputNative(); | ||
} | ||
|
||
public byte[] GetUserEnvironmentVariable(byte[] key) { | ||
return GetUserEnvironmentVariableNative(key); | ||
} | ||
public byte[] SetUserEnvironmentVariable(byte[] key, byte[] value) { | ||
return SetUserEnvironmentVariableNative(key, value); | ||
} | ||
public byte[] DeleteUserEnvironmentVariable(byte[] key) { | ||
return DeleteUserEnvironmentVariableNative(key); | ||
} | ||
|
||
public String GetKnownFolderPath(String rfid) { | ||
return GetKnownFolderPathNative(rfid); | ||
} | ||
}; | ||
NativeApi.set(nativeApi); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
windows-jni-utils-coursierapi/src/main/java/coursierapi/internal/jniutils/NativeCalls.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,46 @@ | ||
package coursierapi.internal.jniutils; | ||
|
||
import coursier.jniutils.LoadWindowsLibrary; | ||
import coursier.jniutils.NativeApi; | ||
|
||
public final class NativeCalls { | ||
|
||
static native String terminalSizeNative(); | ||
|
||
static native String enableAnsiOutputNative(); | ||
|
||
static native byte[] GetUserEnvironmentVariableNative(byte[] key); | ||
static native byte[] SetUserEnvironmentVariableNative(byte[] key, byte[] value); | ||
static native byte[] DeleteUserEnvironmentVariableNative(byte[] key); | ||
|
||
static native String GetKnownFolderPathNative(String rfid); | ||
|
||
|
||
public static void setup() { | ||
LoadWindowsLibrary.ensureInitialized(); | ||
NativeApi nativeApi = new NativeApi() { | ||
public String terminalSize() { | ||
return terminalSizeNative(); | ||
} | ||
|
||
public String enableAnsiOutput() { | ||
return enableAnsiOutputNative(); | ||
} | ||
|
||
public byte[] GetUserEnvironmentVariable(byte[] key) { | ||
return GetUserEnvironmentVariableNative(key); | ||
} | ||
public byte[] SetUserEnvironmentVariable(byte[] key, byte[] value) { | ||
return SetUserEnvironmentVariableNative(key, value); | ||
} | ||
public byte[] DeleteUserEnvironmentVariable(byte[] key) { | ||
return DeleteUserEnvironmentVariableNative(key); | ||
} | ||
|
||
public String GetKnownFolderPath(String rfid) { | ||
return GetKnownFolderPathNative(rfid); | ||
} | ||
}; | ||
NativeApi.set(nativeApi); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
windows-jni-utils-lmcoursier/src/main/java/lmcoursier/internal/jniutils/NativeCalls.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,46 @@ | ||
package lmcoursier.internal.jniutils; | ||
|
||
import coursier.jniutils.LoadWindowsLibrary; | ||
import coursier.jniutils.NativeApi; | ||
|
||
public final class NativeCalls { | ||
|
||
static native String terminalSizeNative(); | ||
|
||
static native String enableAnsiOutputNative(); | ||
|
||
static native byte[] GetUserEnvironmentVariableNative(byte[] key); | ||
static native byte[] SetUserEnvironmentVariableNative(byte[] key, byte[] value); | ||
static native byte[] DeleteUserEnvironmentVariableNative(byte[] key); | ||
|
||
static native String GetKnownFolderPathNative(String rfid); | ||
|
||
|
||
public static void setup() { | ||
LoadWindowsLibrary.ensureInitialized(); | ||
NativeApi nativeApi = new NativeApi() { | ||
public String terminalSize() { | ||
return terminalSizeNative(); | ||
} | ||
|
||
public String enableAnsiOutput() { | ||
return enableAnsiOutputNative(); | ||
} | ||
|
||
public byte[] GetUserEnvironmentVariable(byte[] key) { | ||
return GetUserEnvironmentVariableNative(key); | ||
} | ||
public byte[] SetUserEnvironmentVariable(byte[] key, byte[] value) { | ||
return SetUserEnvironmentVariableNative(key, value); | ||
} | ||
public byte[] DeleteUserEnvironmentVariable(byte[] key) { | ||
return DeleteUserEnvironmentVariableNative(key); | ||
} | ||
|
||
public String GetKnownFolderPath(String rfid) { | ||
return GetKnownFolderPathNative(rfid); | ||
} | ||
}; | ||
NativeApi.set(nativeApi); | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
windows-jni-utils-tests/src/coursier/jniutils/AnsiTerminal.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
2 changes: 0 additions & 2 deletions
2
windows-jni-utils-tests/src/coursier/jniutils/EnvironmentVariable.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
2 changes: 0 additions & 2 deletions
2
windows-jni-utils-tests/src/coursier/jniutils/KnownFolders.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
20 changes: 18 additions & 2 deletions
20
windows-jni-utils-tests/test/src/coursier/jniutils/tests/WindowsKnownFoldersTests.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
32 changes: 32 additions & 0 deletions
32
windows-jni-utils/src/main/c/coursier_bootstrap_launcher_jniutils_NativeCalls.c
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,32 @@ | ||
#include "coursier_bootstrap_launcher_jniutils_NativeCalls.h" | ||
#include "coursier_jniutils_NativeCalls.h" | ||
|
||
JNIEXPORT jstring JNICALL Java_coursier_bootstrap_launcher_jniutils_NativeCalls_terminalSizeNative | ||
(JNIEnv *env, jclass class) { | ||
return Java_coursier_jniutils_NativeCalls_terminalSizeNative(env, class); | ||
} | ||
|
||
JNIEXPORT jstring JNICALL Java_coursier_bootstrap_launcher_jniutils_NativeCalls_enableAnsiOutputNative | ||
(JNIEnv *env, jclass class) { | ||
return Java_coursier_jniutils_NativeCalls_enableAnsiOutputNative(env, class); | ||
} | ||
|
||
JNIEXPORT jbyteArray JNICALL Java_coursier_bootstrap_launcher_jniutils_NativeCalls_GetUserEnvironmentVariableNative | ||
(JNIEnv *env, jclass class, jbyteArray key) { | ||
return Java_coursier_jniutils_NativeCalls_GetUserEnvironmentVariableNative(env, class, key); | ||
} | ||
|
||
JNIEXPORT jbyteArray JNICALL Java_coursier_bootstrap_launcher_jniutils_NativeCalls_SetUserEnvironmentVariableNative | ||
(JNIEnv *env, jclass class, jbyteArray key, jbyteArray value) { | ||
return Java_coursier_jniutils_NativeCalls_SetUserEnvironmentVariableNative(env, class, key, value); | ||
} | ||
|
||
JNIEXPORT jbyteArray JNICALL Java_coursier_bootstrap_launcher_jniutils_NativeCalls_DeleteUserEnvironmentVariableNative | ||
(JNIEnv *env, jclass class, jbyteArray key) { | ||
return Java_coursier_jniutils_NativeCalls_DeleteUserEnvironmentVariableNative(env, class, key); | ||
} | ||
|
||
JNIEXPORT jstring JNICALL Java_coursier_bootstrap_launcher_jniutils_NativeCalls_GetKnownFolderPathNative | ||
(JNIEnv *env, jclass class, jstring rfid) { | ||
return Java_coursier_jniutils_NativeCalls_GetKnownFolderPathNative(env, class, rfid); | ||
} |
61 changes: 61 additions & 0 deletions
61
windows-jni-utils/src/main/c/coursier_bootstrap_launcher_jniutils_NativeCalls.h
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.