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

Jameica und Hibiscus Abhängigkeit im build definieren und bauen #677

Merged
merged 27 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
29 changes: 29 additions & 0 deletions .github/actions/build-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Reusable build steps
description: Setups the build environment and builds Jameica and Hibiscus
runs:
using: "composite"
steps:
- name: Set up JDK for x64
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
architecture: x64

- name: Restore build dependencies
id: restore-cache
uses: actions/cache@v4
with:
path: |
jameica/bin/
jameica/lib/
jameica/releases/jameica-lib.jar
hibiscus/bin/
hibiscus/lib/
hibiscus/releases/hibiscus-lib.jar
key: ${{ hashFiles('jverein/build/build.properties', 'jverein/build/build.xml') }}

- name: Build Jameica and Hibiscus
if: steps.restore-cache.outputs.cache-hit != 'true'
shell: bash
run: ant -noinput -buildfile jverein/build/build.xml build-dependencies
20 changes: 5 additions & 15 deletions .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,19 @@ on:
- 'lib.src/**'
- 'src/**'
- '.github/workflows/**/*.yml'
- '.github/actions/**/*.yml'
push:
jobs:
call-reusable-workflow:
uses: ./.github/workflows/reusable-build.yml

build-check:
needs: call-reusable-workflow
runs-on: ubuntu-latest
steps:
- name: Restore cached tags and jars
id: cache-tags-jars
uses: actions/cache@v4
with:
path: |
./cached-tags
jameica
hibiscus
key: ${{ runner.os }}-${{ github.repository_id }}

- name: Checkout openjverein
uses: actions/checkout@v4
with:
path: jverein

- name: Setup
uses: ./jverein/.github/actions/build-dependencies

- name: Build openjverein plugin
working-directory: ./
run: ant -noinput -buildfile jverein/build/build.xml compile
18 changes: 3 additions & 15 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,19 @@ on:
- '**'

jobs:
call-reusable-workflow:
uses: ./.github/workflows/reusable-build.yml

nightly-build:
needs: call-reusable-workflow
runs-on: ubuntu-latest
steps:
- name: Restore cached tags and jars
id: cache-tags-jars
uses: actions/cache@v4
with:
path: |
./cached-tags
jameica
hibiscus
key: ${{ runner.os }}-${{ github.repository_id }}

- name: Checkout openjverein
uses: actions/checkout@v4
with:
path: jverein

- name: Setup
uses: ./jverein/.github/actions/build-dependencies

- name: Build openjverein plugin
id: openjverein
working-directory: ./
run: |
ant_output=$(ant -e -q -noinput -buildfile jverein/build/build.xml nightly)
echo ${ant_output}
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,19 @@ name: OpenJVerein official release
on: workflow_dispatch

jobs:
call-reusable-workflow:
uses: ./.github/workflows/reusable-build.yml

release:
needs: call-reusable-workflow
runs-on: ubuntu-latest
steps:
- name: Restore cached tags and jars
id: cache-tags-jars
uses: actions/cache@v4
with:
path: |
./cached-tags
jameica
hibiscus
key: ${{ runner.os }}-${{ github.repository_id }}

- name: Checkout openjverein
uses: actions/checkout@v4
with:
path: jverein

- name: Setup
uses: ./jverein/.github/actions/build-dependencies

- name: Build openjverein plugin
id: openjverein
working-directory: ./
run: |
ant_output=$(ant -e -q -noinput -buildfile jverein/build/build.xml)
echo ${ant_output}
Expand Down
97 changes: 0 additions & 97 deletions .github/workflows/reusable-build.yml

This file was deleted.

5 changes: 5 additions & 0 deletions build/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ project.javadoc = ${project.release}/javadoc
project.zipdir = ${project.release}/${plugin.name}
project.zipfilename = ${plugin.name}.${plugin.version}.zip
project.zipfilename.nightly = ${plugin.name}.${plugin.version}-nightly.zip

jameica.url = https://github.com/willuhn/jameica/archive/refs/tags
jameica.version = V_2_10_5_BUILD_488
hibiscus.url = https://github.com/willuhn/hibiscus/archive/refs/tags
hibiscus.version = V_2_10_24_BUILD_388
69 changes: 52 additions & 17 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<loadproperties srcfile="${build.dir}/build.properties" />

<echo message="VERSION: ${plugin.version}" level="info"/>
<echo message="BUILD : ${build.number}" level="info"/>
<echo message="JAVA : ${java.version}" level="info"/>
<echo message="VERSION: ${plugin.version}" level="info" />
<echo message="BUILD : ${build.number}" level="info" />
<echo message="JAVA : ${java.version}" level="info" />

<path id="compilepath">
<fileset dir="${lib.dir}">
Expand Down Expand Up @@ -54,9 +54,10 @@

<target name="compile" depends="init, clean">
<mkdir dir="${class.dir}" />
<javac debug="true" includeantruntime="false" debuglevel="lines,vars,source" release="${define.java.version}" encoding="${define.encoding}" deprecation="true" destdir="${class.dir}" srcdir="${src.dir}">
<classpath refid="compilepath" />
</javac>
<javac debug="true" includeantruntime="false" debuglevel="lines,vars,source" release="${define.java.version}"
encoding="${define.encoding}" deprecation="true" destdir="${class.dir}" srcdir="${src.dir}">
<classpath refid="compilepath" />
</javac>
</target>

<target name="jar" depends="init,compile" description="Generates the jar file">
Expand Down Expand Up @@ -84,7 +85,7 @@

<copy todir="${project.zipdir}" file="plugin.xml" />
<replace file="${project.zipdir}/plugin.xml">
<replacefilter token="[PLUGIN_ZIP]" value="${project.zipfilename}"/>
<replacefilter token="[PLUGIN_ZIP]" value="${project.zipfilename}" />
</replace>

<!-- Jetzt muessen wir noch das ZIP-File erzeugen -->
Expand Down Expand Up @@ -142,16 +143,16 @@
<delete dir="${project.tmp}" />
<delete dir="${class.dir}" />
</target>

<target name="lib">
<!-- Die Datei brauchen die anderen Plugins zum Kompilieren //-->
<copy file="${project.zipdir}/${define.jarfilename}" tofile="releases/jverein-lib.jar" />
</target>

<target name="all" depends="init,jar,javadoc,src,clean" description="Build an official openjverein release">
<echo message="SELECTED_VERSION=${plugin.version}" />
<echo message="SELECTED_PATH=${project.release}/${project.zipfilename}" />
<echo message="SELECTED_FILENAME=${project.zipfilename}" />
<echo message="SELECTED_VERSION=${plugin.version}" />
<echo message="SELECTED_PATH=${project.release}/${project.zipfilename}" />
<echo message="SELECTED_FILENAME=${project.zipfilename}" />
</target>

<target name="fast" depends="init,jar,src" description="Build an development release">
Expand All @@ -161,16 +162,50 @@
<target name="nightly" depends="init,compile,jar,javadoc,src" description="Build an nightly release">
<mkdir dir="${project.release.nightly}" />

<copy file="${project.release}/${project.zipfilename}" tofile="${project.release.nightly}/${project.zipfilename.nightly}" />
<copy file="${project.release}/${define.srcfilename}" tofile="${project.release.nightly}/${define.srcfilename.nightly}" />
<copy file="${project.release}/${project.zipfilename}"
tofile="${project.release.nightly}/${project.zipfilename.nightly}" />
<copy file="${project.release}/${define.srcfilename}"
tofile="${project.release.nightly}/${define.srcfilename.nightly}" />

<antcall target="lib"/>
<antcall target="lib" />

<delete dir="${project.release}" />

<echo message="SELECTED_VERSION=${plugin.version}-nightly" />
<echo message="SELECTED_PATH=${project.release.nightly}/${project.zipfilename.nightly}" />
<echo message="SELECTED_FILENAME=${project.zipfilename.nightly}" />
<echo message="SELECTED_VERSION=${plugin.version}-nightly" />
<echo message="SELECTED_PATH=${project.release.nightly}/${project.zipfilename.nightly}" />
<echo message="SELECTED_FILENAME=${project.zipfilename.nightly}" />
</target>

<target name="build-dependencies" description="Downloads and builds Jameica and Hibiscus"
depends="init">
<antcall target="build-package">
<param name="name" value="jameica" />
<param name="url" value="${jameica.url}" />
<param name="version" value="${jameica.version}" />
</antcall>
<antcall target="build-package">
<param name="name" value="hibiscus" />
<param name="url" value="${hibiscus.url}" />
<param name="version" value="${hibiscus.version}" />
</antcall>
</target>

<target name="build-package">
<!-- Download package -->
<get src="${url}/${version}.zip"
dest="${name}-${version}.zip"
skipexisting="true" />

<!-- Unpack into folder $name -->
<unzip src="${name}-${version}.zip"
dest="../" />
<move file="../${name}-${version}"
tofile="../${name}" />

<!-- Run build -->
<ant dir="../${name}" antfile="build/build.xml" inheritall="false">
<target name="nightly" />
</ant>
</target>

</project>