diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index abb766a..874a9fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,7 +154,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' - name: AVD cache diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 96110e1..ccf65d9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,12 +19,12 @@ cmake_minimum_required(VERSION 3.16) add_subdirectory("src/cpp" ${CMAKE_CURRENT_BINARY_DIR}/test) add_custom_target(build-jnigen - COMMAND ./gradlew -Pcode.version=SNAPSHOT publishToMavenLocal + COMMAND ./gradlew --no-daemon -Pcode.version=SNAPSHOT publishToMavenLocal WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../jnigen ) add_custom_target(test-jnigen ALL - COMMAND ./gradlew -Pcode.version=SNAPSHOT test + COMMAND ./gradlew --no-daemon -Pcode.version=SNAPSHOT test WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../jnigen ) diff --git a/tests/android/.gitignore b/tests/android/.gitignore index 3166b90..ee6ce7b 100644 --- a/tests/android/.gitignore +++ b/tests/android/.gitignore @@ -1 +1,2 @@ .cxx/ +/app/libs/ diff --git a/tests/android/CMakeLists.txt b/tests/android/CMakeLists.txt index e5525c6..8ad3dbe 100644 --- a/tests/android/CMakeLists.txt +++ b/tests/android/CMakeLists.txt @@ -20,7 +20,8 @@ find_package (Python3 COMPONENTS Interpreter REQUIRED) add_custom_target(javabuild DEPENDS build-jnigen - COMMAND ${CMAKE_CURRENT_LIST_DIR}/gradlew -PbuildDir=${CMAKE_CURRENT_BINARY_DIR}/gradle :app:compileDebugJavaWithJavac + COMMAND ./gradlew --no-daemon -Porg.gradle.jvmargs='-Xmx2048m -Dfile.encoding=UTF-8' -Pandroid.useAndroidX=true + -PbuildDir=${CMAKE_CURRENT_BINARY_DIR}/gradle :app:compileDebugJavaWithJavac WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) @@ -30,7 +31,8 @@ add_custom_target(androidbuild ALL DEPENDS javabuild smjnitests COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_LIST_DIR}/app/libs/${ANDROID_ABI} COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_LIST_DIR}/app/libs/${ANDROID_ABI}/$ - COMMAND ${CMAKE_CURRENT_LIST_DIR}/gradlew -PbuildDir=${CMAKE_CURRENT_BINARY_DIR}/gradle :app:assembleDebug + COMMAND ./gradlew --no-daemon -Porg.gradle.jvmargs='-Xmx2048m -Dfile.encoding=UTF-8' -Pandroid.useAndroidX=true + -PbuildDir=${CMAKE_CURRENT_BINARY_DIR}/gradle :app:assembleDebug WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} ) diff --git a/tests/android/app/libs/x86_64/libsmjnitests.so b/tests/android/app/libs/x86_64/libsmjnitests.so deleted file mode 100755 index 96cc66d..0000000 Binary files a/tests/android/app/libs/x86_64/libsmjnitests.so and /dev/null differ diff --git a/tests/android/app/src/main/AndroidManifest.xml b/tests/android/app/src/main/AndroidManifest.xml index da4d179..5fef4cf 100644 --- a/tests/android/app/src/main/AndroidManifest.xml +++ b/tests/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/tests/android/app/src/main/java/com/example/smjni_test/TestContentProvider.java b/tests/android/app/src/main/java/com/example/smjni_test/TestContentProvider.java index 282c1d2..044e5f2 100644 --- a/tests/android/app/src/main/java/com/example/smjni_test/TestContentProvider.java +++ b/tests/android/app/src/main/java/com/example/smjni_test/TestContentProvider.java @@ -1,3 +1,19 @@ +/* + Copyright 2023 SimpleJNI Contributors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package com.example.smjni_test; import android.content.ContentProvider; diff --git a/tests/android/parse-output.py b/tests/android/parse-output.py index 5aac504..8af3157 100644 --- a/tests/android/parse-output.py +++ b/tests/android/parse-output.py @@ -1,3 +1,19 @@ +# +# Copyright 2023 SmJNI Contributors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import sys import json diff --git a/tests/desktop/CMakeLists.txt b/tests/desktop/CMakeLists.txt index 9b63f41..f277c8e 100644 --- a/tests/desktop/CMakeLists.txt +++ b/tests/desktop/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(Java COMPONENTS Development REQUIRED) add_custom_target(javabuild DEPENDS build-jnigen - COMMAND ${CMAKE_CURRENT_LIST_DIR}/gradlew -PbuildDir=${CMAKE_CURRENT_BINARY_DIR}/java assemble + COMMAND ./gradlew --no-daemon -PbuildDir=${CMAKE_CURRENT_BINARY_DIR}/java assemble WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} )