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

Use Ant for building NetBeans Gradle Tooling #6816

Merged
merged 1 commit into from
Dec 9, 2023
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
7 changes: 0 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }}
restore-keys: ${{ runner.os }}-

- name: Setup Gradle Daemon to run on JDK 11
if: ${{ matrix.java == '21' }}
run: |
mkdir -p ~/.gradle
#uses a preinstalled JDK 11 from the runner
echo "org.gradle.java.home=$JAVA_HOME_11_X64" >> ~/.gradle/gradle.properties

- name: Build NetBeans
run: ant $OPTS -quiet -Dcluster.config=$CLUSTER_CONFIG build-nozip

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ $ ant -q clean
#### Notes:
* You can also use `php`, `enterprise`, etc. See the [cluster.properties](https://github.com/apache/netbeans/blob/master/nbbuild/cluster.properties) file.
* Once built, you can simply open individual modules of interest with NetBeans and run/rebuild/debug them like any other project
* Building the gradle modules on recent JDKs might fail with "Unsupported class file major version" errors. In that case the gradle daemon must be
configured to run on a compatible JDK (for example add `org.gradle.java.home=/home/duke/jdk17` to your `~/.gradle/gradle.properties`, see [gradle doc](https://docs.gradle.org/current/userguide/build_environment.html)).

#### Generating Javadoc

Expand Down
6 changes: 1 addition & 5 deletions extide/gradle/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@
</target>

<target name="build-tooling-lib" depends="-download.release.files,-copy-gradle-wrapper,-uptodate-tooling" unless="tooling.uptodate">
<java fork="true" dir="${tooling}" classpath="${tooling}/gradle/wrapper/gradle-wrapper.jar" classname="org.gradle.wrapper.GradleWrapperMain" failonerror="true">
<sysproperty key="org.gradle.appname" value="Gradle"/>
<arg line="--offline"/>
<arg line="clean build -x check"/>
</java>
<ant dir="${tooling}" inheritAll="false" target="build" />
<copy file="${tooling}/build/libs/${tooling}.jar" todir="build/tooling" overwrite="true"/>
<copy file="${tooling}/src/main/resources/nb-tooling.gradle" todir="build/tooling" overwrite="true"/>
</target>
Expand Down
61 changes: 61 additions & 0 deletions extide/gradle/netbeans-gradle-tooling/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.

-->
<project basedir="." default="build" name="netbeans-gradle-tooling">
<description>Builds, tests, and runs the project org.netbeans.modules.gradle</description>

<property name="tooling" value="netbeans-gradle-tooling"/>
<property name="gradle.version" value="7.4" />

<available property="has.gradle-libs" file="build/gradle-libs" type="dir"/>

<path id="compile.classpath">
<fileset dir="build/gradle-libs" includes="*.jar"/>
</path>

<target name="prepare-libs" unless="has.gradle-libs">
<mkdir dir="build/gradle-libs"/>
<unzip src="../external/gradle-${gradle.version}-bin.zip" dest="build/gradle-libs">
<patternset>
<include name="gradle-${gradle.version}/lib/**/*.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
</target>
<target name="compile" depends="prepare-libs">
<mkdir dir="build/classes/java/main"/>
<javac srcdir="src/main/java" destdir="build/classes/java/main" classpathref="compile.classpath" release="8" includeantruntime="false"/>
</target>

<target name="jar" depends="compile">
<mkdir dir="build/libs"/>
<jar destfile="build/libs/${tooling}.jar" basedir="build/classes/java/main">
<fileset dir="src/main/resources"/>
</jar>
</target>

<target name="build" depends="jar"/>

<target name="clean">
<delete dir="build"/>
</target>
</project>

Loading