Skip to content

Commit

Permalink
feat: adds lazysodium-java (fork) as submodule (algorandfoundation#6)
Browse files Browse the repository at this point in the history
* fix: make sure to include the gradle-wrapper jar

* try adding gradle build step

* fix invalid gradle name

* fix: aciton name

* test gradle wrapper

* feat: generate .jar files adhoc
  • Loading branch information
HashMapsData2Value authored Mar 4, 2024
1 parent 1789a3e commit 44d04a1
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 17 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/gradlew-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]

jobs:
test:
test-and-build:
runs-on: ubuntu-latest

steps:
Expand All @@ -17,9 +17,15 @@ jobs:
java-version: "11"
distribution: "adopt"

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Run gradle wrapper
run: gradle wrapper

- name: Run tests
run: ./gradlew test

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ replay_pid*
# Ignore Gradle build output directory
build

# Include the .jar files that we import
!lib/libs/*.jar
# But include the gradle-wrapper .jar file
!gradle/wrapper/gradle-wrapper.jar
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lazysodium-java"]
path = lazysodium-java
url = https://github.com/algorandfoundation/lazysodium-java
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic"
}
5 changes: 5 additions & 0 deletions buildJars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd lazysodium-java
./gradlew build
cd ..
mv lazysodium-java/build/libs/* lib/libs/
./gradlew test
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
1 change: 1 addition & 0 deletions lazysodium-java
Submodule lazysodium-java added at d9e3ae
Binary file removed lib/libs/lazysodium-java-5.1.5-javadoc.jar
Binary file not shown.
Binary file removed lib/libs/lazysodium-java-5.1.5-sources.jar
Binary file not shown.
Binary file removed lib/libs/lazysodium-java-5.1.5.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions lib/src/main/kotlin/bip32ed25519/Bip32Ed25519.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package bip32ed25519

// import kotlinx.serialization.cbor.Cbor

import com.goterl.lazysodium.LazySodiumJava
import com.goterl.lazysodium.SodiumJava
import com.goterl.lazysodium.utils.LibraryLoader
Expand Down

0 comments on commit 44d04a1

Please sign in to comment.