-
Notifications
You must be signed in to change notification settings - Fork 18
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
Maven build ermöglichen und automatisieren #614
base: feature-3.1.0
Are you sure you want to change the base?
Changes from all commits
88769ce
9c80f83
0b59e37
afd1cf5
aa5180f
3331d23
fd8559d
2a5b4b9
b15be6b
ddea2b3
e9033e8
65bf062
4586bf3
8b4acba
93d9c48
c4243d8
0c7f93a
0814007
dfb4105
e6bb886
dd05fb6
d73682f
2044afd
b1d7b80
cee3a02
7905ad5
d1cb7e6
3f8768d
a3726b7
e489b00
c57c185
89dd5eb
5f0ebd9
a72f299
6003c26
aa1ab8b
a492c6d
0ca0bf8
df3bfa8
d11657e
f1db21d
869b492
d1d515c
d6ce8c1
29fd1b8
c3d024f
255b1c5
463648d
01c9450
d97f860
8102234
a5f02e1
e788529
293b954
cb941c3
0df89ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry excluding="fonts/*|holidays/*|img/*|lang/*|liquibase/*|main/*" including="**/*.java" kind="src" output="target/classes" path="src"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="junit/src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry exported="true" kind="src" path="/jameica"/> | ||
<classpathentry kind="lib" path="lib/nc.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/javax.mail-1.6.2.jar"/> | ||
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/hibiscus"/> | ||
<classpathentry exported="true" kind="lib" path="lib/activation.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/hibiscus/lib/obantoo-bin-2.1.12.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/bsh-core-2.0b4.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/csvjdbc-1.0.40.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/itext-hyph-xml.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/jollyday-0.5.10.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/joda-time-2.12.7.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/snakeyaml-2.2.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/jameica/lib/swt/win64/swt.jar" sourcepath="/jameica/lib.src/swt/linux/swt.src.zip"/> | ||
<classpathentry exported="true" kind="lib" path="lib/junit-4.13.2.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/javase-3.5.3.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/core-3.1.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/jameica/lib/de_willuhn_ds/de_willuhn_ds.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/hibiscus/lib/super-csv-2.4.0.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/hibiscus/lib/itext-pdfa-5.5.2.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/hibiscus/lib/itextpdf-5.5.2.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/freemarker-2.3.33.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/jackson-core-2.17.2.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/jsoup-1.18.1.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/vinnie-2.0.2.jar"/> | ||
<classpathentry exported="true" kind="lib" path="lib/ez-vcard-0.12.1.jar"/> | ||
<classpathentry exported="true" kind="lib" path="/hibiscus/lib/pdfbox/pdfbox-3.0.2.jar"/> | ||
<classpathentry kind="lib" path="lib/xmpbox-3.0.3.jar"/> | ||
<classpathentry kind="lib" path="lib/jakarta.activation-api-2.1.3.jar"/> | ||
<classpathentry kind="lib" path="lib/dom4j-2.1.4.jar"/> | ||
<classpathentry kind="lib" path="lib/mustang-2.16.0.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,91 +7,30 @@ jobs: | |
setup-java-and-cache: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up JDK for x64 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
architecture: x64 | ||
|
||
- name: Set env | ||
id: setenvs | ||
run: | | ||
jameica_tag=$(git ls-remote --refs --tags --sort="-v:refname" https://github.com/willuhn/jameica.git V_\* | head -1 | cut -f 2 | cut -d / -f 3) | ||
echo "jameica_tag=${jameica_tag}" >> $GITHUB_ENV | ||
hibiscus_tag=$(git ls-remote --refs --tags --sort="-v:refname" https://github.com/willuhn/hibiscus.git V_\* | head -1 | cut -f 2 | cut -d / -f 3) | ||
Comment on lines
-20
to
-22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hier bestimmen wir die aktuellen release tags dynamisch. In der POM hast du sie hart kodiert. Kann man das auch dynamisieren? Sonst verlieren wir wieder Flexibilität. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Das macht den build aber nicht wiederholbar, da er vom Zustand externer Quellen abhängt. Ich würde vorschlagen renovate einzubauen und sehr bewusst die genutzte Version zu aktualisieren. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Da hast du Recht. Das ist jedoch für die nightly builds absolut relevant. Nicht, dass wir von den Quellen abhängig wären. Wir bräuchten die Libs von Jameica und Hibiscus. Wenn die in einem maven repository lägen, wäre das ideal. Da könnten zumindest die Releases liegen. Ich hatte auch schon versucht, über Repology die aktuelle Version zu bekommen. Da habe ich jedoch die Rest-API nicht richtig nutzen können. In #516 (comment) hatte ich zumindest mal das Fetching der Jars mit remotezip dokumentiert. Vielleicht ist das für diesen PR eine Möglichkeit? Zumindest braucht es für unsere Releases kein compile der nightlies von Jameica und Hibiscus. Das wäre nur für unser future-proof notwendig.
Meinst du https://github.com/renovatebot/renovate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ich meine genau das renovate. Das hat github-tags als data source. D.h. man kann es konfigurieren, automatisch einen pull reuqest zu stellen, wenn Jameica oder Hibiscus ein neue Version bereitstellen. Die baut dann natürlich auch und du siehst sofort, ob es noch baut. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ich habe übrigens auch schon mal getestet, die benötigten jars in das GitHub maven repository zu installieren, das funktioniert auch, und würde den tatsächlichen build step völlig unabhängig vom reusable-Build machen. Zum lokalen Test braucht man immer noch die Plugin.zip entpackt und es ist wirklich nett, direkt in den source von Jamaica zu schauen. |
||
echo "hibiscus_tag=${hibiscus_tag}" >> $GITHUB_ENV | ||
echo "### jameica_tag: ${jameica_tag} | hibiscus_tag: ${hibiscus_tag}" | ||
|
||
- name: Restore cached tags and folders | ||
id: cache-tags-jars | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
./cached-tags | ||
jameica | ||
hibiscus | ||
key: ${{ runner.os }}-${{ github.repository_id }} | ||
|
||
- name: Load cached tags | ||
id: load-cache | ||
run: | | ||
if [ -f ./cached-tags/jameica_tag ]; then | ||
cached_jameica_tag=$(cat ./cached-tags/jameica_tag) | ||
echo "cached_jameica_tag=${cached_jameica_tag}" >> $GITHUB_ENV | ||
else | ||
echo "cached_jameica_tag=" >> $GITHUB_ENV | ||
fi | ||
if [ -f ./cached-tags/hibiscus_tag ]; then | ||
cached_hibiscus_tag=$(cat ./cached-tags/hibiscus_tag) | ||
echo "cached_hibiscus_tag=${cached_hibiscus_tag}" >> $GITHUB_ENV | ||
else | ||
echo "cached_hibiscus_tag=" >> $GITHUB_ENV | ||
fi | ||
echo "### cached_jameica_tag: ${cached_jameica_tag} | cached_hibiscus_tag: ${cached_hibiscus_tag}" | ||
|
||
- name: Checkout jameica | ||
if: ${{ env.cached_jameica_tag != env.jameica_tag }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: willuhn/jameica | ||
path: jameica | ||
ref: ${{ env.jameica_tag }} | ||
|
||
- name: Build jameica jar | ||
if: ${{ env.cached_jameica_tag != env.jameica_tag }} | ||
working-directory: ./ | ||
run: | | ||
ant -noinput -buildfile jameica/build/build.xml jar | ||
find jameica/releases/ -type f -name jameica.jar -exec cp {} jameica/releases/jameica-lib.jar \; | ||
|
||
- name: Checkout hibiscus | ||
if: ${{ env.cached_hibiscus_tag != env.hibiscus_tag }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: willuhn/hibiscus | ||
path: hibiscus | ||
ref: ${{ env.hibiscus_tag }} | ||
|
||
- name: Build hibiscus jar | ||
if: ${{ env.cached_hibiscus_tag != env.hibiscus_tag }} | ||
working-directory: ./ | ||
run: | | ||
ant -noinput -buildfile hibiscus/build/build.xml jar | ||
find hibiscus/releases/ -type f -name hibiscus.jar -exec cp {} hibiscus/releases/hibiscus-lib.jar \; | ||
|
||
- name: Create cache files and needed folders | ||
run: | | ||
mkdir -p ./cached-tags | ||
echo "${{ env.jameica_tag }}" > ./cached-tags/jameica_tag | ||
echo "${{ env.hibiscus_tag }}" > ./cached-tags/hibiscus_tag | ||
|
||
- name: Cache tags and folders | ||
uses: actions/cache@v4 | ||
if: always() | ||
with: | ||
path: | | ||
./cached-tags | ||
jameica | ||
hibiscus | ||
key: ${{ runner.os }}-${{ github.repository_id }} | ||
- name: Set up JDK for x64 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
architecture: x64 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore cache | ||
id: restore-cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: cache-${{ hashFiles('setup-build.xml') }} | ||
|
||
- name: Run setup-build.xml | ||
if: steps.restore-cache.outputs.cache-hit != 'true' | ||
run: ./mvnw --batch-mode --file setup-build.xml clean install | ||
|
||
- name: Save cache | ||
if: steps.restore-cache.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ~/.m2/repository | ||
tobidope marked this conversation as resolved.
Show resolved
Hide resolved
|
||
key: cache-${{ hashFiles('setup-build.xml') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier könnte man sicher noch einiges nach
reusable-build.yaml
auslagern.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Der build hier nutzt einen anderen hash. Das kann man schlecht zusammenlegen