| /******************************************************************************** |
| * Copyright (c) 2015-2018 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| ********************************************************************************/ |
| plugins { |
| id "de.undercouch.download" version "3.2.0" |
| id 'maven-publish' |
| id 'java-library' |
| } |
| |
| import de.undercouch.gradle.tasks.download.Download |
| |
| def atfxVersion = '0.7.4' |
| description = 'Downloads openATFX and publishes it to the local maven repository' |
| |
| dependencies { |
| compile 'org.slf4j:jcl-over-slf4j:1.7.25' |
| compile 'org.slf4j:log4j-over-slf4j:1.7.25' |
| compile 'org.codehaus.woodstox:woodstox-core-asl:4.4.1' |
| |
| // actually we just need the org.asam.ods.* classes |
| compile "org.eclipse.mdm:org.eclipse.mdm.api.odsadapter:${version}" |
| testCompile 'org.apache.commons:commons-math:2.2' |
| } |
| |
| configurations.all { |
| // stax-api is included in Java 6 or higher |
| exclude group: 'javax.xml.stream', module: 'stax-api' |
| } |
| |
| jar { |
| manifest { |
| attributes( |
| 'Implementation-Title' : 'openATFX', |
| 'Implementation-Version' : atfxVersion, |
| 'Implementation-URL' : 'https://sourceforge.net/projects/openatfx' |
| ) |
| } |
| } |
| |
| task downloadOpenATFX(type: Download) { |
| acceptAnyCertificate true |
| overwrite false |
| // use mirror subdomain of 'https://sourceforge.net/projects/openatfx/files/openatfx-${atfxVersion}-jars.zip/download' |
| // because gradle has problems establishing a ssl connection with sourceforge directly |
| src "https://liquidtelecom.dl.sourceforge.net/project/openatfx/openatfx-${atfxVersion}-jars.zip" |
| dest file("${buildDir}/openatfx-${atfxVersion}-jars.zip") |
| outputs.file dest |
| } |
| |
| task unzipOpenATFX(dependsOn: downloadOpenATFX, type: Copy) { |
| from zipTree(downloadOpenATFX.dest) |
| into buildDir |
| outputs.dir file("${buildDir}/openatfx-${atfxVersion}") |
| } |
| |
| task copySource(dependsOn: unzipOpenATFX, type: Copy) { |
| from file("${buildDir}/openatfx-${atfxVersion}/src") |
| into 'src' |
| } |
| |
| compileJava.dependsOn copySource |
| /** |
| * Some tests in openATFX throw NPEs when executed with the ODS Corba classes generated |
| * by SunORB. The issue occurs, if an attribute is left uninitialized and then serialized. |
| */ |
| tasks.withType(Test) {enabled = false} |