Skip to content

Commit

Permalink
Update to JCOBridge 2.5.17, update version and added tests on MacOS (#…
Browse files Browse the repository at this point in the history
…181)

* Update to JCOBridge 2.5.17, update version and added tests on MacOS

* Package preparation update

* Added specific mac section

* Removed testbranch workflow

* Added error upload in tests
  • Loading branch information
masesdevelopers authored Jun 22, 2024
1 parent 6e20d1a commit b62f401
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:

- name: Install local file to be used within Javadoc section of generated POM
shell: bash
run: mvn install:install-file --no-transfer-progress -Dfile=../../../bin/${{ matrix.framework }}/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.14 -Dpackaging=jar -f ./src/jvm/src/${{ matrix.framework }}.xml
run: mvn install:install-file --no-transfer-progress -Dfile=../../../bin/${{ matrix.framework }}/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.17 -Dpackaging=jar -f ./src/jvm/src/${{ matrix.framework }}.xml

- name: Publish ${{ matrix.framework }} to Apache Maven Central
shell: bash
Expand Down
161 changes: 157 additions & 4 deletions .github/workflows/reflect_test_commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ name: CI_REFLECT_TEST_COMMIT
# events but only for the master branch
on:
push:
branches: [ master ]
# only trigger on branches, not on tags
branches: '**'

# This workflow contains two jobs called "check" and "build_windows"
jobs:
# Verify if a build is needed
check:
if: ${{ github.repository_owner == 'masesgroup' || (github.repository_owner != 'masesgroup' && github.ref_name != 'master') }} #do not execute on master outside main repo
name: Check changed files
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
Expand Down Expand Up @@ -292,6 +294,12 @@ jobs:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}

- uses: actions/upload-artifact@v4
with:
name: Errors_java_tests_windows_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1

execute_scala_tests_windows:
needs: build_windows
strategy:
Expand Down Expand Up @@ -408,19 +416,30 @@ jobs:
shell: cmd
continue-on-error: true

execute_java_tests_linux:
- uses: actions/upload-artifact@v4
with:
name: Errors_scala_tests_windows_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1

execute_java_tests_unix:
needs: build_linux
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macos-latest', 'macos-13' ]
framework: [ 'net6.0', 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net6.0
- jdk_vendor: oracle
jdk_version: 11

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
Expand Down Expand Up @@ -494,6 +513,12 @@ jobs:
#java -cp "./bin/net6.0/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOutBase
#java -cp "./bin/net6.0/JCOReflector.jar;./tests/jvm/java/src/" refout.HelloRefOut

- uses: actions/upload-artifact@v4
with:
name: Errors_java_tests_${{ matrix.os }}_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1

execute_scala_tests_linux:
needs: build_linux
strategy:
Expand Down Expand Up @@ -600,8 +625,136 @@ jobs:
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: rm -rf ./tests/jvm/scala/output

- uses: actions/upload-artifact@v4
with:
name: Errors_java_tests_linux_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1

execute_scala_tests_mac:
needs: build_linux
strategy:
fail-fast: false
matrix:
os: [ 'macos-latest', 'macos-13' ]
framework: [ 'net8.0' ]
jdk_vendor: [ 'temurin', 'zulu', 'microsoft', 'corretto', 'oracle']
jdk_version: [ '11', '17', '21' ] # only LTS versions
exclude:
- os: macos-latest
framework: net6.0
- os: macos-13
framework: net6.0
- jdk_vendor: oracle
jdk_version: 11

runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: '1'

- name: Restore JCOReflector bin from cache
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
enableCrossOsArchive: true
path: ./bin/
key: JCOReflector_linux_bin_${{ github.sha }}

- name: Set up JDK distribution
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.jdk_vendor }}
java-version: ${{ matrix.jdk_version }}
cache: 'maven'

- name: Download and install Scala package
run: brew install [email protected]

- name: Export Scala root
if: matrix.os == 'macos-13'
run: |
echo "SCALA_BIN=/usr/local/opt/[email protected]/bin" >> $GITHUB_ENV
shell: bash

- name: Export Scala root
if: matrix.os == 'macos-latest'
run: |
echo "SCALA_BIN=/opt/homebrew/opt/[email protected]/bin" >> $GITHUB_ENV
shell: bash

- name: Prepare extra argument
if: matrix.framework == 'net6.0'
shell: bash
run: echo "EXTRA_ARGUMENT=--CoreCLRApp:Microsoft.NET6.App" >> $GITHUB_ENV

- name: Build Scala test source file
run: |
mkdir ./tests/jvm/scala/output
${{ env.SCALA_BIN }}/scalac -cp "./bin/${{ matrix.framework }}/*" -d ./tests/jvm/scala/output ./tests/jvm/scala/src/main/scala/hierarchy/* ./tests/jvm/scala/src/main/scala/mscorlib/* ./tests/jvm/scala/src/main/scala/nettest/* ./tests/jvm/scala/src/main/scala/refout/*
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloLock ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNet ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloNETEvent ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" mscorlib.HelloIterator ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloHierarchy ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" hierarchy.HelloInterfaces ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" nettest.HelloNETSocket -async ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOutBase ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: ${{ env.SCALA_BIN }}/scala -nobootcp -toolcp "./bin/${{ matrix.framework }}/*:./tests/jvm/scala/output" refout.HelloRefOut ${{ env.EXTRA_ARGUMENT }}
continue-on-error: true
env:
JCOBRIDGE_SCOPEDON: JCOReflector|1.0.0
JCOBRIDGE_LicensePath: ${{ secrets.JCOBRIDGE_ONLINE }}
- run: rm -rf ./tests/jvm/scala/output

- uses: actions/upload-artifact@v4
with:
name: Errors_scala_tests_${{ matrix.os }}_${{ matrix.framework }}_${{ matrix.jdk_vendor }}_${{ matrix.jdk_version }}
path: .\hs_err_*
retention-days: 1

execute_finalize:
needs: [execute_java_tests_windows, execute_scala_tests_windows, execute_java_tests_linux, execute_scala_tests_linux]
needs: [execute_java_tests_windows, execute_scala_tests_windows, execute_java_tests_unix, execute_scala_tests_linux, execute_scala_tests_mac]

runs-on: windows-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Install local file to be used within Javadoc section of generated POM
shell: bash
run: mvn install:install-file --no-transfer-progress -Dfile=../../../bin/${{ matrix.framework }}/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.14 -Dpackaging=jar -f ./src/jvm/src/${{ matrix.framework }}.xml
run: mvn install:install-file --no-transfer-progress -Dfile=../../../bin/${{ matrix.framework }}/JCOBridge.jar -DgroupId=JCOBridge -DartifactId=JCOBridge -Dversion=2.5.17 -Dpackaging=jar -f ./src/jvm/src/${{ matrix.framework }}.xml

- name: Publish ${{ matrix.framework }} to Apache Maven Central
shell: bash
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/net/CLI/JCOReflectorCLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Copyright>Copyright © MASES s.r.l. 2024</Copyright>
<Authors>MASES s.r.l.</Authors>
<Company>MASES s.r.l.</Company>
<Version>1.14.2.0</Version>
<Version>1.14.3.0</Version>
<Product>MASES.JCOReflectorCLI</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
Expand Down
2 changes: 1 addition & 1 deletion src/net/CLI/JCOReflectorCLI.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>MASES.JCOReflectorCLI</id>
<version>1.14.2</version>
<version>1.14.3</version>
<title>JCOReflector CLI - CLI interface for JCOReflector Engine</title>
<authors>MASES s.r.l.</authors>
<owners>MASES s.r.l.</owners>
Expand Down
2 changes: 1 addition & 1 deletion src/net/GUI/JCOReflectorGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Copyright>Copyright © MASES s.r.l. 2024</Copyright>
<Authors>MASES s.r.l.</Authors>
<Company>MASES s.r.l.</Company>
<Version>1.14.2.0</Version>
<Version>1.14.3.0</Version>
<Product>JCOReflectorGUI</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<TargetFrameworks>net462;net6.0-windows;net8.0-windows</TargetFrameworks>
Expand Down
6 changes: 6 additions & 0 deletions src/net/engine/Const.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ public static string GetRelativePath(string filespec, string folder)
Path.Combine("linux-arm64", "libnethost.so"),
Path.Combine("linux-x64", "J2CBridgeHostActivator.so"),
Path.Combine("linux-x64", "libnethost.so"),
Path.Combine("osx-arm64", "J2CBridgeHostActivator.dylib"),
Path.Combine("osx-arm64", "libnethost.dylib"),
Path.Combine("osx-x64", "J2CBridgeHostActivator.dylib"),
Path.Combine("osx-x64", "libnethost.dylib"),
#if !NET8_0
Path.Combine("win-arm", "J2CBridgeHostActivator.dll"),
Path.Combine("win-arm", "nethost.dll"),
Expand All @@ -198,8 +202,10 @@ public static string GetRelativePath(string filespec, string folder)
"J2CBridge_Arm.so",
"J2CBridge_Arm64.dll",
"J2CBridge_Arm64.so",
"J2CBridge_Arm64.dylib",
"J2CBridge_x64.dll",
"J2CBridge_x64.so",
"J2CBridge_x64.dylib",
"J2CBridge_x86.dll",
"JCOBridge.docs.jar",
"JCOBridge.jar",
Expand Down
4 changes: 2 additions & 2 deletions src/net/engine/JCOReflectorEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Copyright>Copyright © MASES s.r.l. 2024</Copyright>
<Authors>MASES s.r.l.</Authors>
<Company>MASES s.r.l.</Company>
<Version>1.14.2.0</Version>
<Version>1.14.3.0</Version>
<Product>MASES.JCOReflectorEngine</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<TargetFrameworks>net462;net6.0;net8.0</TargetFrameworks>
Expand Down Expand Up @@ -115,7 +115,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MASES.CLIParser" Version="3.2.1" />
<PackageReference Include="MASES.JCOBridge" Version="2.5.14">
<PackageReference Include="MASES.JCOBridge" Version="2.5.17">
<IncludeAssets>All</IncludeAssets>
<PrivateAssets>None</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit b62f401

Please sign in to comment.