Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Java CI #213

Merged
merged 18 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test
name: Build

on:
workflow_dispatch:
Expand All @@ -13,11 +13,9 @@ concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
ICE_HOME: ${{ github.workspace }}/ice # Makefile
IceHome: ${{ github.workspace }}/ice # MSBuild
Platform: x64 # For Msbuild
Configuration: Release # For Msbuild
# env:
# Platform: x64 # For Msbuild
# Configuration: Release # For Msbuild

jobs:
ci:
Expand All @@ -28,16 +26,31 @@ jobs:
include:
- os: ubuntu-22.04
ice_build_flags: srcs
csharp_build_command: dotnet build
- os: macos-14
ice_build_flags: srcs
csharp_build_command: dotnet build
- os: windows-2022
ice_build_flags: /t:BuildDist
csharp_build_command: MSBuild

runs-on: ${{ matrix.os }}
steps:
- name: Windows Environment
if: runner.os == 'Windows'
run: |
echo "Platform=x64" >> $env:GITHUB_ENV
echo "Configuration=Release" >> $env:GITHUB_ENV
echo "IceHome=${{ github.workspace }}\ice" >> $env:GITHUB_ENV

# We need to replace \ with / in the path, specifically for Gradle
$iceHome = "${{ github.workspace }}/ice"
$iceHome = $iceHome.Replace("\", "/")
echo "ICE_HOME=$iceHome" >> $env:GITHUB_ENV

- name: Linux/MacOS Environment
if: runner.os != 'Windows'
run: |
echo "ICE_HOME=${{ github.workspace }}/ice" >> $GITHUB_ENV
echo "IceHome=${{ github.workspace }}/ice" >> $GITHUB_ENV

- name: Checkout Ice
uses: actions/checkout@v4
with:
Expand All @@ -50,10 +63,10 @@ jobs:

- name: Build Ice on ${{ matrix.os }}
uses: ./ice/.github/actions/build
timeout-minutes: 90
timeout-minutes: 60
with:
working_directory: ice
build_flags: ${{ matrix.ice_build_flags || '' }}
build_flags: ${{ runner.os == 'Windows' && '/t:BuildDist' || 'srcs' }}

- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -62,12 +75,21 @@ jobs:

- name: Build C++ Demos on ${{ matrix.os }}
uses: ./ice/.github/actions/build
timeout-minutes: 30
timeout-minutes: 20
with:
working_directory: ice-demos/cpp
msbuild_project: msbuild/ice.proj

- name: Build C# Demos on ${{ matrix.os }}
timeout-minutes: 30
timeout-minutes: 20
working-directory: ice-demos/csharp
run: ${{ matrix.csharp_build_command }} /m msbuild/ice.proj
run: ${{ runner.os == 'Windows' && 'MSBuild' || 'dotnet msbuild' }} /m msbuild/ice.proj

- name: Build Java Demos on ${{ matrix.os }}
timeout-minutes: 20
working-directory: ice-demos/java
env:
# For Ice Builder for Gradle
CPP_PLATFORM: x64
CPP_CONFIGURATION: Release
run: ./gradlew build
1 change: 0 additions & 1 deletion java/Chat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies {
implementation 'com.jgoodies:jgoodies-looks:2.6.0'
implementation 'com.jgoodies:jgoodies-forms:1.8.0'
implementation localDependency("ice")
runtimeOnly localDependency("icessl")
implementation localDependency("glacier2")
}

Expand Down
5 changes: 2 additions & 3 deletions java/Chat/src/main/java/com/zeroc/demos/Chat/Coordinator.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import com.zeroc.Glacier2.SessionHelper;
import com.zeroc.Glacier2.SessionCallback;
import com.zeroc.Glacier2.SessionNotExistException;
import com.zeroc.Ice.Util;

class Coordinator
{
Expand All @@ -55,14 +54,14 @@ public Coordinator(MainView mainView, LoginView loginView, ChatView chatView, De
com.zeroc.Ice.InitializationData initData = new com.zeroc.Ice.InitializationData();

java.util.List<String> rArgs = new java.util.ArrayList<>();
initData.properties = com.zeroc.Ice.Util.createProperties(_args, rArgs);
initData.properties = new com.zeroc.Ice.Properties(_args, rArgs);
_args = rArgs.toArray(new String[rArgs.size()]);

initData.properties.setProperty("Ice.Plugin.IceSSL", "com.zeroc.IceSSL.PluginFactory");

// Load the configuration file.
initData.properties.setProperty("Ice.Default.Package", "com.zeroc.demos");
initData.properties = Util.createProperties(args, initData.properties);
initData.properties = new com.zeroc.Ice.Properties(args, initData.properties);

//
// Set Ice.Default.Router if not set.
Expand Down
6 changes: 0 additions & 6 deletions java/Database/README.md

This file was deleted.

Loading