Skip to content

Commit

Permalink
Fixed classpath for Java
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Oct 8, 2024
2 parents bd995fc + de427b6 commit a4fdcce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ jobs:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: ❓ Investigate Java environment
run: |
ls -lAh /usr/share/gradle-*
ls -lAh /usr/share/gradle-*/lib/junit-*
ls -lAh /usr/share/gradle-*/lib/hamcrest-*
- name: ✅ Run the Ant 'junit' target
run: |
cd examples/Java/JUnit
Expand Down
16 changes: 13 additions & 3 deletions examples/Java/JUnit/build-github.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,31 @@
<mkdir dir="${build}" />
</target>

<path id="path.junit">
<fileset dir="/usr/share/">
<include name="gradle-*/lib/junit-*.jar"/>
<include name="gradle-*/lib/hamcrest-core-*.jar"/>
</fileset>
</path>

<pathconvert property="path.junit.str" refid="path.junit"/>

<echo>JUnit Classpath is ${path.junit.str}</echo>

<target name="compile" depends="init" description="compile the source">
<javac destdir="${build}" includeantruntime="false">
<src path="${src}" />
<src path="${test}" />
<classpath>
<pathelement location="/usr/share/gradle-8.10.2/lib/junit-4.13.2.jar"/>
<path refid="path.junit"/>
</classpath>
</javac>
</target>

<target name="junit" depends="compile">
<junit haltonerror="true" printsummary="true">
<classpath>
<pathelement location="/usr/share/gradle-8.10.2/lib/junit-4.13.2.jar"/>
<pathelement location="/usr/share/gradle-8.10.2/lib/hamcrest-core-1.3.jar"/>
<path refid="path.junit"/>
<pathelement location="${build}"/>
</classpath>
<formatter type="xml"/>
Expand Down

0 comments on commit a4fdcce

Please sign in to comment.