Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d1d5972
feat: add value for enum
dorotaphanSiili Jun 5, 2025
8652907
chores: change the structure of files
dorotaphanSiili Jun 5, 2025
24ff18a
feat(api): extend interface
dorotaphanSiili Jun 6, 2025
738419d
fix(api): add and remove event listner
dorotaphanSiili Jun 6, 2025
a408c3e
feat(api): property change now has only new value
dorotaphanSiili Jun 6, 2025
889a703
feat(api): split api file
dorotaphanSiili Jun 24, 2025
f765c35
feat(api): add gradle project files
dorotaphanSiili Aug 5, 2025
c62050a
feat(android): add skeleton for service adapter
dorotaphanSiili Aug 13, 2025
2198513
feat(android): add android service project files
dorotaphanSiili Aug 13, 2025
50311c0
feat(stub): add stub feature
dorotaphanSiili Jul 3, 2025
324e4d8
feat(android): add messages and basic parcelable
dorotaphanSiili Jul 4, 2025
22b18d6
feat(android): add messenger to service
dorotaphanSiili Jul 8, 2025
6796008
feat(adnroid): extend tests for service
dorotaphanSiili Aug 14, 2025
2ecd227
feat(jni): add service backend allowing jni impl
dorotaphanSiili Aug 13, 2025
d02200d
feat(adroid): Add client with project files
dorotaphanSiili Jul 9, 2025
3021341
feat(andorid): add tests for client
dorotaphanSiili Aug 14, 2025
3ad626f
feat: extend event listener
dorotaphanSiili Jul 11, 2025
e237095
feat(example) add client example
dorotaphanSiili Jul 14, 2025
1ad83b3
feat(adnroid): sync initial state of service side
dorotaphanSiili Jul 18, 2025
586c86d
feat(android): support enums
dorotaphanSiili Jul 21, 2025
0d83e7a
feat(api): add copy ctor for structs
dorotaphanSiili Jul 23, 2025
103a44d
feat(android): add helpers for handlig arrays
dorotaphanSiili Jul 23, 2025
db97dc3
feat(android): handle arrays data types
dorotaphanSiili Jul 23, 2025
a7bfb0e
feat(example): add test service example skeleton
dorotaphanSiili Jul 31, 2025
9f37128
feat(jni): add client jni bridge
dorotaphanSiili Aug 14, 2025
7c98cad
docs: update on implemented features
dorotaphanSiili Aug 25, 2025
43dc33e
fix: change module name filter
dorotaphanSiili Aug 29, 2025
8017017
feat: structs support complex and nested struct as data fields
dorotaphanSiili Aug 29, 2025
7ae071a
feat: comparison operators for struct
dorotaphanSiili Aug 29, 2025
7e81cd8
feat: improve comparing complex types
dorotaphanSiili Aug 30, 2025
82c0b5c
feat: add example app
dorotaphanSiili Sep 8, 2025
decec71
add goldenmaster
dorotaphanSiili Sep 8, 2025
c886772
feat: add github workflow
dorotaphanSiili Sep 8, 2025
f003040
fix(jni): fix unbind, to work even if called multiple times
dorotaphanSiili Sep 26, 2025
93a34a2
fix(jni): clean up the static members for service adapter
dorotaphanSiili Sep 30, 2025
5be1cb8
feat: support imports and externs
dorotaphanSiili Oct 13, 2025
e12f805
fix: add goldenmaster for imports, externs, ref if
dorotaphanSiili Oct 20, 2025
92b389d
fix(android): set correct class loader on receive rpc resp
dorotaphanSiili Oct 27, 2025
c943165
fix: fix interfaces comparison
dorotaphanSiili Oct 28, 2025
bdff2ff
chores: update test-apis
dorotaphanSiili Oct 30, 2025
28b4582
fix: fix for ref interfaces tests
dorotaphanSiili Oct 31, 2025
cc6f3d0
fix: clean up log levels
dorotaphanSiili Nov 27, 2025
38c7752
fix: fix string comparision
dorotaphanSiili Dec 4, 2025
e0cfff3
fix: remove unused reference which may cause mem leak
dorotaphanSiili Dec 4, 2025
b8cf43d
chores: make intention explicit on used threads
dorotaphanSiili Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
77 changes: 77 additions & 0 deletions .github/workflows/ci_run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow will checks that the goldenmaster passes all tests

name: Test Goldenmaster

on:
pull_request:
branches: [main]

env:
GITHUB_AUTH_TOKEN: ${{ secrets.WOLFGANG_REPO_PACKAGE_READ }}
GOPRIVATE: "github.com/apigear-io/*"
GH_ACCESS_TOKEN: ${{ secrets.APIGEAR_REPOS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
go_version: "1.21.x"

jobs:
build:
runs-on: ubuntu-latest
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

# Set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

# set up go
- uses: actions/setup-go@v5
with:
go-version: ${{env.go_version}}

# Set up Android SDK (needed for AGP and compileSdk)
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 34
build-tools: 34.0.0
ndk: 25.2.9519653
components: platform-tools,cmdline-tools

# Set up Gradle
- name: Set up Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: '8.10' # Quotes required to prevent YAML converting to number
use-wrapper: false
# remove auto generated gradle files before the gradle version is set
- name: Clean any generated wrappers
run: |
find goldenmaster -type d -name wrapper -exec rm -rf {} +
echo "Removed any gradle/wrapper folders in submodules"

# Build all modules
- name: Build all modules
working-directory: goldenmaster
run: gradle runAll --stacktrace

# Run all unit tests (JVM tests for Android modules)
- name: Run all tests
working-directory: goldenmaster
run: gradle runJavaUnitTests --stacktrace

# Upload JUnit / Robolectric test reports as artifacts
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: 'goldenmaster/**/build/test-results/test'
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

.DS_Store
.vscode/
.vs/
.idea/
**/bin/
**/.gradle/
**/build/
test/
/demo/app/bin
/demo/gradle
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ApiGear Java Template

This is a template for creating a Java project using ApiGear.
For more details on *ApiGear* please visit [apigear.io](https://apigear.io) or the [*ApiGear* documentation](https://docs.apigear/).

## Usage

Expand Down Expand Up @@ -28,17 +29,19 @@ See the [ApiGear documentation](https://apigear.io/docs/intro) for more informat

## Supported Features

This is a very basic template. It supports only the core features of ApiGear.
This is not fully implemented template. It supports only some of the ApiGear features.

## Features

- API:
- Simple API using interfaces, enums, POJOs, etc.
The template offers the following feature switches which can be enabled during code generation:
* `api`: create interface files and an abstract implementation
* `stubs`: create a stub implementation, that handles all the properties, but is missing the business logic.
* `android`: create the adaptation layer for android messenger communication. Produces the client and the service sides for the interfaces.
* `jnibridge`: create the java jni implementation, that is missing the c++ side and build files. See example of using it in the jni feature in unreal template.
* `testclientapp`: create example messenger client application. This is not ready to use example - the logic for generated buttons should be filled (which values to send), the rest is already there. The app serves only first defined interface.
* `testserviceapp`: create example messenger service application. This is not ready to use example - the logic for generated buttons should be filled (which values to send), the rest is already there. The app serves only first defined interface.

## Planned Features

- github workflow
- scaffold: maven/gradle support
- demo app
- imports: support for importing other APIs
- extends: support for extending other APIs
Expand Down
5 changes: 5 additions & 0 deletions apigear/goldenmaster.solution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ targets:
- ../test-apis/testbed.same2.module.yaml
- ../test-apis/testbed.simple.module.yaml
- ../test-apis/testbed.struct.module.yaml
- ../test-apis/custom_types.module.yaml
- ../test-apis/extern_types.module.yaml
- ../test-apis/counter.module.yaml
- ../test-apis/testbed.ifaceimport.module.yaml
- ../test-apis/testbed.refifaces.module.yaml
output: ../test
template: ..
force: true
Expand Down
82 changes: 82 additions & 0 deletions goldenmaster/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}

}

tasks.register('runAll') {

description = "Builds app and all included builds (modulex, moduley) with all submodules"
group = "build"
dependsOn gradle.includedBuild('testbed2').task(':testbed2_android_service:build')
dependsOn gradle.includedBuild('testbed2').task(':testbed2_android_client:build')
dependsOn gradle.includedBuild('testbed2').task(':testbed2_android_messenger:build')
dependsOn gradle.includedBuild('testbed2').task(':testbed2_impl:build')
dependsOn gradle.includedBuild('testbed2').task(':testbed2_api:build')
dependsOn gradle.includedBuild('tbEnum').task(':tbEnum_android_service:build')
dependsOn gradle.includedBuild('tbEnum').task(':tbEnum_android_client:build')
dependsOn gradle.includedBuild('tbEnum').task(':tbEnum_android_messenger:build')
dependsOn gradle.includedBuild('tbEnum').task(':tbEnum_impl:build')
dependsOn gradle.includedBuild('tbEnum').task(':tbEnum_api:build')
dependsOn gradle.includedBuild('tbNames').task(':tbNames_android_service:build')
dependsOn gradle.includedBuild('tbNames').task(':tbNames_android_client:build')
dependsOn gradle.includedBuild('tbNames').task(':tbNames_android_messenger:build')
dependsOn gradle.includedBuild('tbNames').task(':tbNames_impl:build')
dependsOn gradle.includedBuild('tbNames').task(':tbNames_api:build')
dependsOn gradle.includedBuild('tbSame1').task(':tbSame1_android_service:build')
dependsOn gradle.includedBuild('tbSame1').task(':tbSame1_android_client:build')
dependsOn gradle.includedBuild('tbSame1').task(':tbSame1_android_messenger:build')
dependsOn gradle.includedBuild('tbSame1').task(':tbSame1_impl:build')
dependsOn gradle.includedBuild('tbSame1').task(':tbSame1_api:build')
dependsOn gradle.includedBuild('tbSame2').task(':tbSame2_android_service:build')
dependsOn gradle.includedBuild('tbSame2').task(':tbSame2_android_client:build')
dependsOn gradle.includedBuild('tbSame2').task(':tbSame2_android_messenger:build')
dependsOn gradle.includedBuild('tbSame2').task(':tbSame2_impl:build')
dependsOn gradle.includedBuild('tbSame2').task(':tbSame2_api:build')
dependsOn gradle.includedBuild('tbSimple').task(':tbSimple_android_service:build')
dependsOn gradle.includedBuild('tbSimple').task(':tbSimple_android_client:build')
dependsOn gradle.includedBuild('tbSimple').task(':tbSimple_android_messenger:build')
dependsOn gradle.includedBuild('tbSimple').task(':tbSimple_impl:build')
dependsOn gradle.includedBuild('tbSimple').task(':tbSimple_api:build')
dependsOn gradle.includedBuild('testbed1').task(':testbed1_android_service:build')
dependsOn gradle.includedBuild('testbed1').task(':testbed1_android_client:build')
dependsOn gradle.includedBuild('testbed1').task(':testbed1_android_messenger:build')
dependsOn gradle.includedBuild('testbed1').task(':testbed1_impl:build')
dependsOn gradle.includedBuild('testbed1').task(':testbed1_api:build')
dependsOn gradle.includedBuild('customTypes').task(':customTypes_android_service:build')
dependsOn gradle.includedBuild('customTypes').task(':customTypes_android_client:build')
dependsOn gradle.includedBuild('customTypes').task(':customTypes_android_messenger:build')
dependsOn gradle.includedBuild('customTypes').task(':customTypes_impl:build')
dependsOn gradle.includedBuild('customTypes').task(':customTypes_api:build')
dependsOn gradle.includedBuild('externTypes').task(':externTypes_android_service:build')
dependsOn gradle.includedBuild('externTypes').task(':externTypes_android_client:build')
dependsOn gradle.includedBuild('externTypes').task(':externTypes_android_messenger:build')
dependsOn gradle.includedBuild('externTypes').task(':externTypes_impl:build')
dependsOn gradle.includedBuild('externTypes').task(':externTypes_api:build')
dependsOn gradle.includedBuild('counter').task(':counter_android_service:build')
dependsOn gradle.includedBuild('counter').task(':counter_android_client:build')
dependsOn gradle.includedBuild('counter').task(':counter_android_messenger:build')
dependsOn gradle.includedBuild('counter').task(':counter_impl:build')
dependsOn gradle.includedBuild('counter').task(':counter_api:build')
dependsOn gradle.includedBuild('tbIfaceimport').task(':tbIfaceimport_android_service:build')
dependsOn gradle.includedBuild('tbIfaceimport').task(':tbIfaceimport_android_client:build')
dependsOn gradle.includedBuild('tbIfaceimport').task(':tbIfaceimport_android_messenger:build')
dependsOn gradle.includedBuild('tbIfaceimport').task(':tbIfaceimport_impl:build')
dependsOn gradle.includedBuild('tbIfaceimport').task(':tbIfaceimport_api:build')
dependsOn gradle.includedBuild('tbRefIfaces').task(':tbRefIfaces_android_service:build')
dependsOn gradle.includedBuild('tbRefIfaces').task(':tbRefIfaces_android_client:build')
dependsOn gradle.includedBuild('tbRefIfaces').task(':tbRefIfaces_android_messenger:build')
dependsOn gradle.includedBuild('tbRefIfaces').task(':tbRefIfaces_impl:build')
dependsOn gradle.includedBuild('tbRefIfaces').task(':tbRefIfaces_api:build')

dependsOn project(':goldenmaster_example').tasks.named('build')

}

tasks.register("runJavaUnitTests") {
description = "Runs all tests in all submodules"
dependsOn subprojects.collect { it.tasks.withType(Test) }
}
22 changes: 22 additions & 0 deletions goldenmaster/counter/counter_android_client/additions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
android {
namespace 'counter.counter_android_client'

tasks.register('packageSources', Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
include '**/*.java'
}
}


dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation project(':counter_api')
implementation project(':counter_android_messenger')
api project(':customTypes_android_messenger')
api project(':externTypes_android_messenger')
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'org.mockito:mockito-inline:5.2.0'
}
38 changes: 38 additions & 0 deletions goldenmaster/counter/counter_android_client/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
plugins {
alias(libs.plugins.android.library)
}

group = "counter"
version = "1.0.0"

android {
namespace 'counter.counter_android_client'
compileSdk 35

defaultConfig {
minSdk 33
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

testOptions {
unitTests.includeAndroidResources = true
}

}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation project(':counter_api')
implementation project(':counter_android_messenger')
api 'customTypes:customTypes_android_messenger:1.0.0'
api 'externTypes:externTypes_android_messenger:1.0.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation project(':counter_impl')
}
Loading
Loading