blob: 0adaf99458f636c817ebea9307f14eaa6ea39d19 [file] [log] [blame]
/********************************************************************************
* 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 'java-library'
id 'maven-publish'
id 'eclipse'
id "com.google.protobuf" version "0.9.4"
}
description = 'MDM API - ODSAdapter'
configurations {
idlLibs
}
configurations.all {
exclude group: 'javax.inject', module: 'javax.inject'
exclude group: 'commons-logging', module: 'commons-logging'
// exclude guava dependencies
exclude group: 'com.google.code.findbugs', module: 'jsr305'
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
exclude group: 'com.google.j2objc', module: 'j2objc-annotations'
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
exclude group: 'org.checkerframework', module: 'checker-compat-qual'
}
dependencies {
compileOnly 'jakarta.platform:jakarta.jakartaee-api:8.0.0'
// logging
implementation 'org.slf4j:slf4j-api:1.7.25'
// httpclient uses commons-logging
implementation 'org.slf4j:jcl-over-slf4j:1.7.25'
// MDM5 API
api project(":api:base")
// Peak notification service
implementation 'com.google.protobuf:protobuf-java:3.2.0'
implementation 'com.google.protobuf:protobuf-java-util:3.2.0'
implementation 'com.google.guava:guava:25.0-jre'
implementation 'org.glassfish.jersey.core:jersey-client:2.28'
implementation 'org.glassfish.jersey.media:jersey-media-sse:2.28'
// querying es
api 'commons-httpclient:commons-httpclient:3.1'
api 'org.apache.commons:commons-text:1.10.0'
// aofileservice
api 'org.apache.commons:commons-lang3:3.3'
// compile CORBA idl using JDK tools
idlLibs files(System.getenv('JAVA_HOME') + '/lib/tools.jar')
idlLibs files('src/main/idl/')
// testing
testImplementation(testFixtures(project(":tools:testutils")))
testImplementation(platform('org.junit:junit-bom:5.10.1'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation("junit:junit:4.13.2")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly 'org.slf4j:slf4j-simple:1.7.25'
testImplementation 'org.testcontainers:junit-jupiter:1.19.3'
testImplementation 'org.mockito:mockito-core:2.13.0'
testImplementation 'org.assertj:assertj-core:3.6.2'
testImplementation "org.elasticsearch.client:elasticsearch-rest-client:6.4.1"
testImplementation "org.testcontainers:elasticsearch:1.19.3"
}
test {
if(project.hasProperty('host')) {
systemProperty 'host', project.property('host')
} else {
systemProperty 'host', '<host>'
}
if(project.hasProperty('port')) {
systemProperty 'port', project.property('port')
} else {
systemProperty 'port', '2809'
}
if(project.hasProperty('service')) {
systemProperty 'service', project.property('service')
} else {
systemProperty 'service', '<service>'
}
jvmArgs '-Dorg.slf4j.simpleLogger.defaultLogLevel=debug'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.2.0'
}
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/idl/main/java'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
task compileIDL(type: JavaExec) {
classpath = configurations.idlLibs
mainClass = 'com.sun.tools.corba.se.idl.toJavaPortable.Compile'
// add 'fallTIE' if <Type>POA & <Type>POATie have to be generated
args '-fallTIE', '-td', 'build/generated/source/idl/main/java', 'src/main/idl/ods530.idl'
inputs.dir('src/main/idl/')
outputs.dir('build/generated/source/idl/main/java')
}
task compileNotificationServiceIDL(type: JavaExec) {
classpath = configurations.idlLibs
mainClass = 'com.sun.tools.corba.se.idl.toJavaPortable.Compile'
args '-emitAll', '-fallTIE', '-i', 'src/main/idl/', '-td', 'build/generated/source/idl/main/java', 'src/main/idl/CosNotifyChannelAdmin.idl'
inputs.dir('src/main/idl/')
outputs.dir('build/generated/source/idl/main/java')
outputs.upToDateWhen { false }
}
compileJava.dependsOn compileIDL
compileJava.dependsOn compileNotificationServiceIDL
jar {
metaInf { from '../NOTICE.txt' }
metaInf { from '../LICENSE.txt' }
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
}
}
}
/*task('sourcesJar', type: Jar, dependsOn: compileJava) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
*/