Skip to content

Commit 74a975c

Browse files
bumps version, gradle fixes, updates config.sh, updates CI workflow
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
1 parent edbcccf commit 74a975c

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ jobs:
1010
build_and_test_cedar_java_ffi:
1111
name: Rust project - latest
1212
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
toolchain:
16-
- stable
1713
steps:
1814
- name: Checkout Cedar Examples
1915
uses: actions/checkout@v3
@@ -24,7 +20,7 @@ jobs:
2420
ref: release/2.3.x
2521
path: ./cedar
2622
- name: rustup
27-
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
23+
run: rustup update 1.75.0 && rustup default 1.75.0 && rustup component add rustfmt
2824
- name: cargo fmt
2925
working-directory: ./CedarJavaFFI
3026
run: cargo fmt --all --check

CedarJava/build.gradle

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ plugins {
2828
id 'signing'
2929
}
3030

31+
sourceCompatibility = JavaVersion.VERSION_17
32+
targetCompatibility = JavaVersion.VERSION_17
33+
3134
/*
3235
Applies community Gradle plugins, usually added as build-tools in Config.
3336
*/
@@ -38,11 +41,18 @@ apply plugin: 'com.github.spotbugs'
3841

3942
apply plugin: 'org.owasp.dependencycheck'
4043

41-
check.dependsOn dependencyCheckAnalyze
44+
if (System.getenv('NVD_API_KEY')) {
45+
check.dependsOn dependencyCheckAnalyze
46+
}
4247
dependencyCheck {
4348
format='HTML'
4449
failBuildOnCVSS=7
4550
suppressionFile='suppressions.xml'
51+
if (System.getenv('NVD_API_KEY')) {
52+
nvd {
53+
apiKey = System.getenv('NVD_API_KEY')
54+
}
55+
}
4656
}
4757

4858
/*
@@ -97,8 +107,8 @@ dependencies {
97107

98108
test {
99109
useJUnitPlatform()
100-
//environment "CEDAR_INTEGRATION_TESTS_ROOT", ''set to absolute path of `cedar-integration-tests`'
101-
//environment 'CEDAR_JAVA_FFI_LIB', 'set to absolute path of cedar_java_ffi native library (including file extension)'
110+
environment 'CEDAR_INTEGRATION_TESTS_ROOT', '/Users/chmudit/cedar-java-3_4_1/mudit-fork/cedar-java/cedar/cedar-integration-tests'
111+
environment 'CEDAR_JAVA_FFI_LIB', '/Users/chmudit/cedar-java-3_4_1/mudit-fork/cedar-java/CedarJavaFFI/target/debug/libcedar_java_ffi.dylib'
102112
testLogging {
103113
showStandardStreams false
104114
exceptionFormat 'full'
@@ -116,7 +126,7 @@ publishing {
116126
from components.java
117127
groupId = 'com.cedarpolicy'
118128
artifactId = 'cedar-java'
119-
version = '2.3.3'
129+
version = '2.3.6'
120130
pom {
121131
name = 'CedarJava'
122132
description = 'Java bindings for Cedar policy language.'

CedarJava/config.sh

100644100755
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@ if [ "$(uname)" == "Darwin" ]; then
1414
else
1515
ffi_lib_str=" environment 'CEDAR_JAVA_FFI_LIB', '"$parent_dir"/CedarJavaFFI/target/debug/libcedar_java_ffi.so'"
1616
fi
17-
sed "101s;.*;$ffi_lib_str;" "build.gradle" > new_build.gradle
18-
mv new_build.gradle build.gradle
17+
sed -i.bak "s|.*environment 'CEDAR_JAVA_FFI_LIB'.*|$ffi_lib_str|" "build.gradle" && rm -f build.gradle.bak
1918

2019
# In CI, we need to pull the latest cedar-policy to match the latest cedar-integration-tests
2120
# We require that integration tests be run
2221
# Outside of CI, we can skip the integration tests (run script with no args)
2322
# If you call this script with `run_int_tests`, we assume you have `cedar` checkout out in the `cedar-java` dir
2423
if [ "$#" -ne 0 ] && [ "$1" == "run_int_tests" ]; then
2524
integration_tests_str=" environment 'CEDAR_INTEGRATION_TESTS_ROOT', '"$parent_dir"/cedar/cedar-integration-tests'"
26-
sed "100s;.*;$integration_tests_str;" "build.gradle" > new_build.gradle
27-
mv new_build.gradle build.gradle
25+
sed -i.bak "s|.*environment.*CEDAR_INTEGRATION_TESTS_ROOT.*|$integration_tests_str|" "build.gradle" && rm -f build.gradle.bak
2826

2927
export MUST_RUN_CEDAR_INTEGRATION_TESTS=1
3028

0 commit comments

Comments
 (0)