Skip to content

Commit ddddfc6

Browse files
Merge pull request #79 from cconlon/androidProject
Sample Android project, Android Gradle GitHub Action, and gradle build fixes
2 parents ce4a5b9 + 14301a1 commit ddddfc6

File tree

97 files changed

+3823
-1336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3823
-1336
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Android Gradle Build test logic
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
required: true
8+
type: string
9+
jdk_distro:
10+
required: true
11+
type: string
12+
jdk_version:
13+
required: true
14+
type: string
15+
16+
jobs:
17+
build_wolfssljni:
18+
runs-on: ${{ inputs.os }}
19+
steps:
20+
- name: Clone wolfcrypt-jni
21+
uses: actions/checkout@v4
22+
23+
# Clone native wolfSSL
24+
- name: Clone native wolfSSL
25+
uses: actions/checkout@v4
26+
with:
27+
repository: 'wolfssl/wolfssl'
28+
path: IDE/Android/app/src/main/cpp/wolfssl
29+
30+
# Copy options.h.in to blank options.h
31+
- name: Create blank options.h
32+
run: cp IDE/Android/app/src/main/cpp/wolfssl/wolfssl/options.h.in IDE/Android/app/src/main/cpp/wolfssl/wolfssl/options.h
33+
34+
# Setup Java
35+
- name: Setup java
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: ${{ inputs.jdk_distro }}
39+
java-version: ${{ inputs.jdk_version }}
40+
41+
# Gradle assembleDebug
42+
- name: Gradle assembleDebug
43+
run: cd IDE/Android && ls && ./gradlew assembleDebug
44+
45+
# Gradle assembleDebugUnitTest
46+
- name: Gradle assembleDebugUnitTest
47+
run: cd IDE/Android && ls && ./gradlew assembleDebugUnitTest
48+
49+
# Gradle assembleDebugAndroidTest
50+
- name: Gradle assembleDebugAndroidTest
51+
run: cd IDE/Android && ls && ./gradlew assembleDebugAndroidTest
52+

.github/workflows/main.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,18 @@ jobs:
139139
jdk_version: ${{ matrix.jdk_version }}
140140
wolfssl_configure: ${{ matrix.wolfssl_configure }}
141141

142+
# ----------------------- Android Gradle build ------------------------
143+
# Run Android gradle build over PR code, only running on Linux with one
144+
# JDK/version for now.
145+
android-gradle:
146+
strategy:
147+
matrix:
148+
os: [ 'ubuntu-latest' ]
149+
jdk_version: [ '21' ]
150+
name: Android Gradle (${{ matrix.os }} Zulu JDK ${{ matrix.jdk_version }})
151+
uses: ./.github/workflows/android_gradle.yml
152+
with:
153+
os: ${{ matrix.os }}
154+
jdk_distro: "zulu"
155+
jdk_version: ${{ matrix.jdk_version }}
156+

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ rpm/spec
1717
*.rpm
1818
wolfcrypt*.tar.gz
1919

20+
# Android
21+
IDE/Android/.idea/deploymentTargetDropDown.xml
22+
IDE/Android/app/.cxx/
23+
IDE/Android/app/src/main/cpp/wolfssl
24+
2025
# Windows
2126
IDE/WIN/.vs
2227
IDE/WIN/wolfcryptjni.vcxproj.user

IDE/Android/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild

IDE/Android/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/codeStyles/Project.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/gradle.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/jarRepositories.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IDE/Android/.idea/misc.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)