Commit 902f2227 authored by Florian Schäfer's avatar Florian Schäfer

Add Wikidata Toolkit, use Ivy to get the dependencies when building with Ant

parent d0bf68be
Pipeline #27540639 passed with stages
in 18 minutes and 51 seconds
......@@ -56,7 +56,6 @@ repositories {
jcenter()
}
dependencies {
packIntoJar("com.fasterxml.jackson.core:jackson-databind:2.9.5")
errorprone("com.google.errorprone:error_prone_core:${versions.errorprone}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
......@@ -66,6 +65,14 @@ dependencies {
testImplementation("com.github.tomakehurst:wiremock:2.18.0")
testImplementation("org.awaitility:awaitility:3.1.2")
}
def ivyModule = new XmlParser().parse(new File("$projectDir/ivy.xml"))
logger.info("Dependencies from ivy.xml (added to configuration `packIntoJar`):")
ivyModule.dependencies.dependency.each {
logger.info("* ${it.@org}:${it.@name}:${it.@rev}")
project.dependencies.packIntoJar("${it.@org}:${it.@name}:${it.@rev}")
}
task copyToLib(type: Sync) {
from(configurations.packIntoJar)
into(file("$projectDir/lib"))
......
<?xml version="1.0" encoding="utf-8"?>
<project name="wikipedia" default="dist" basedir=".">
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="wikipedia" default="dist" basedir=".">
<property name="plugin.src.dir" value="src/main/java"/>
<!-- edit the properties of this plugin in the file `gradle.properties` -->
......@@ -22,4 +22,24 @@
</fileset>
</copy>
</target>
<property name="ivy.home" value="${user.home}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>
<target name="download-ivy">
<mkdir dir="${ivy.jar.dir}"/>
<get src="https://jcenter.bintray.com/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<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="pre-compile" description="retrieve dependencies with Ivy" depends="init-ivy">
<ivy:retrieve/>
</target>
</project>
<ivy-module version="2.0">
<info organisation="org.openstreetmap.josm.plugins" module="wikipedia"/>
<dependencies>
<dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="2.9.6"/>
<dependency org="org.wikidata.wdtk" name="wdtk-wikibaseapi" rev="0.9.0"/>
<dependency org="org.wikidata.wdtk" name="wdtk-dumpfiles" rev="0.9.0"/>
</dependencies>
</ivy-module>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment