Skip to content

Commit

Permalink
Use Ant for building NetBeans Gradle Tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
lkishalmi committed Dec 8, 2023
1 parent 0ce04e9 commit 38d9335
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
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 antfile="${tooling}/build.xml" 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>

0 comments on commit 38d9335

Please sign in to comment.