Skip to content

Commit

Permalink
Ivy is more trouble than it's worth; don't use it.
Browse files Browse the repository at this point in the history
  • Loading branch information
szegedi committed Nov 17, 2020
1 parent e55e4c9 commit 1b32647
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 104 deletions.
50 changes: 24 additions & 26 deletions make/nashorn/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
questions.
-->

<project name="nashorn" xmlns:ivy="antlib:org.apache.ivy.ant" default="test" basedir="../..">
<project name="nashorn" default="test" basedir="../..">
<import file="build-nasgen.xml"/>
<import file="code_coverage.xml"/>

Expand Down Expand Up @@ -52,6 +52,7 @@
<available file="/usr/local/bin/git"/>
</condition>
<!-- check if TestNG and dependencies are available, and download them if they aren't -->
<property name="repo.url" value="https://repo1.maven.org/maven2"/>
<antcall target="get-testng"/>
<condition property="testng.available" value="true">
<and>
Expand Down Expand Up @@ -147,7 +148,6 @@
<echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
<echo message="run.test.xms=${run.test.xms}"/>
<echo message="run.test.xmx=${run.test.xmx}"/>

</target>

<target name="prepare" depends="init">
Expand All @@ -162,22 +162,16 @@
<property name="dist.dir.resolved" location="${dist.dir}"/>
</target>

<target name="get-ivy" depends="prepare">
<property name="ivy.install.version" value="2.5.0"/>
<property name="ivy.jar.dir" location="${build.dir}/ivy"/>
<property name="ivy.jar.file" location="${ivy.jar.dir}/ivy.jar"/>
<mkdir dir="${ivy.jar.dir}"/>
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>

<target name="get-deps" depends="get-ivy">
<mkdir dir="${deps.dir}"/>
<ivy:resolve file="make/nashorn/ivy-core.xml"/>
<ivy:retrieve pattern="${deps.dir}/[artifact].[ext]" sync="true" type="jar"/>
<target name="get-deps" depends="prepare">
<property name="asm.version" value="7.3.1"/>
<property name="asm.url" value="${repo.url}/org/ow2/asm"/>
<get dest="${deps.dir}" skipexisting="true">
<url url="${asm.url}/asm/${asm.version}/asm-${asm.version}.jar"/>
<url url="${asm.url}/asm-analysis/${asm.version}/asm-analysis-${asm.version}.jar"/>
<url url="${asm.url}/asm-commons/${asm.version}/asm-commons-${asm.version}.jar"/>
<url url="${asm.url}/asm-tree/${asm.version}/asm-tree-${asm.version}.jar"/>
<url url="${asm.url}/asm-util/${asm.version}/asm-util-${asm.version}.jar"/>
</get>
</target>

<target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
Expand Down Expand Up @@ -276,10 +270,14 @@
<target name="artifacts" depends="jar-nashorn, javadoc">
<property name="artifacts.dir" location="${build.dir}/artifacts"/>
<mkdir dir="${artifacts.dir}"/>
<property name="ivy.deliver.revision" value="${nashorn.version}"/>
<ivy:deliver deliverpattern="${artifacts.dir}/ivy-[revision].xml"/>
<ivy:makepom ivyfile="${artifacts.dir}/ivy-${nashorn.version}.xml" pomfile="${artifacts.dir}/nashorn-core-${nashorn.version}.pom"/>
<copy file="${nashorn.jar}" tofile="${artifacts.dir}/nashorn-core-${nashorn.version}.jar"/>

<property name="resolved.pom.file" location="${artifacts.dir}/nashorn-core-${nashorn.version}.pom"/>
<copy file="${nashorn.jar}" tofile="${artifacts.dir}/nashorn-core-${nashorn.version}.jar" force="true"/>
<copy file="make/nashorn/nashorn-core.pom" tofile="${resolved.pom.file}"/>
<replace file="${resolved.pom.file}">
<replacefilter token="ASM_VERSION" value="${asm.version}"/>
<replacefilter token="NASHORN_VERSION" value="${nashorn.version}"/>
</replace>
<jar jarfile="${artifacts.dir}/nashorn-core-${nashorn.version}-javadoc.jar">
<fileset dir="${dist.javadoc.dir}"/>
</jar>
Expand Down Expand Up @@ -814,10 +812,10 @@ grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" {
<!-- download and install testng.jar -->
<target name="get-testng">
<get dest="${test.lib}" skipexisting="true">
<url url="https://repo1.maven.org/maven2/org/testng/testng/6.8/testng-6.8.jar"/>
<url url="https://repo1.maven.org/maven2/com/beust/jcommander/1.27/jcommander-1.27.jar"/>
<url url="https://repo1.maven.org/maven2/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
<url url="https://repo1.maven.org/maven2/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar"/>
<url url="${repo.url}/org/testng/testng/6.8/testng-6.8.jar"/>
<url url="${repo.url}/com/beust/jcommander/1.27/jcommander-1.27.jar"/>
<url url="${repo.url}/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
<url url="${repo.url}/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar"/>
</get>
</target>

Expand Down
49 changes: 0 additions & 49 deletions make/nashorn/ivy-core.xml

This file was deleted.

29 changes: 0 additions & 29 deletions make/nashorn/ivysettings.xml

This file was deleted.

67 changes: 67 additions & 0 deletions make/nashorn/nashorn-core.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the LICENSE file that accompanied this code.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.openjdk.nashorn</groupId>
<artifactId>nashorn-core</artifactId>
<name>OpenJDK Nashorn</name>
<version>NASHORN_VERSION</version>
<packaging>jar</packaging>
<description>Nashorn is an Open Source JavaScript (ECMAScript 5.1 and some 6 features) engine for the JVM.</description>
<url>https://github.com/openjdk/nashorn</url>

<licenses>
<license>
<name>GPL v2 with the Classpath exception</name>
<url>https://github.com/openjdk/nashorn/blob/main/LICENSE</url>
</license>
</licenses>

<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>ASM_VERSION</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>ASM_VERSION</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>ASM_VERSION</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-util</artifactId>
<version>ASM_VERSION</version>
</dependency>
</dependencies>
</project>

0 comments on commit 1b32647

Please sign in to comment.