Skip to content

Commit

Permalink
Converted maven-based build system to gradle
Browse files Browse the repository at this point in the history
Squashed to prepare for develop rebase
  • Loading branch information
oxisto authored and milux committed Jul 11, 2018
1 parent ff275fd commit aafd018
Show file tree
Hide file tree
Showing 39 changed files with 895 additions and 8,701 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -30,6 +30,8 @@
/.recommenders/
rat-repository/src/main/docker/jar/*
.DS_Store
bin
out

# Karaf Deploy
/karaf-assembly/src/main/resources/deploy/*.xml
12 changes: 5 additions & 7 deletions .gitlab-ci.yml
@@ -1,4 +1,4 @@
image: maven
image: node:8-stretch

stages:
- build
Expand All @@ -7,14 +7,12 @@ stages:
build:
stage: build
before_script:
- mkdir -p /root/.m2
- echo $M2_SETTINGS > ~/.m2/settings.xml
- mkdir -p /cache/.m2
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt update && apt install -y nodejs yarn
script:
- mvn clean -DskipITs install site --batch-mode
- apt update && apt install -y openjdk-8-jdk
script:
- ./gradlew clean install
artifacts:
when: always
paths:
Expand Down
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 0 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties

This file was deleted.

119 changes: 119 additions & 0 deletions build.gradle
@@ -0,0 +1,119 @@
plugins {
id 'java'
id 'com.google.protobuf' version '0.8.5'
id 'com.moowork.node' version '1.2.0'
id 'biz.aQute.bnd' version '3.3.0' apply false
id 'com.github.lburgazzoli.karaf' version '0.0.49'
}

allprojects {
group = 'de.fhg.ids'
version = '1.1.0-SNAPSHOT'

ext.libraryVersions = [
// basically, the first requirement, all other libraries depend on this version
karaf : '4.2.0',
pax : '7.0.0',

camel : '2.21.1',

// Camel ships with cxf, however it is slightly older so we want a newer version
cxf : '3.2.4',

// OSGI libraries
osgiCompendium: '5.0.0',
osgiAnnotation: '6.0.0',
felixFramework: '5.4.0',

ahc : '2.4.9',
acme : '2.0',
checkerQual : '2.5.2',
guava : '25.1-jre',
kotlin : '1.2.41',
tuprolog : '3.2.1',
log4j : '2.6.2',
junit4 : '4.12',
mapdb : '3.0.7',
jnrunix : '0.18',
protobuf : '3.5.1',

// it seems not all jetty components are in our BOM so we need to specify it here as well
jetty : '9.4.11.v20180605',

// we will pull in a newer version of jackson because of security fixes
jackson : '2.9.5',

// needed for rat-repository, should be seperated
jersey : '2.26',
mockito : '1.10.19'
]

configurations {
// just to make boms easier to see in the dependency tree
bom
implementation.extendsFrom bom
testImplementation.extendsFrom bom

// an implementation dependency that will be provided through a feature in the OSGi environment
providedByFeature
implementation.extendsFrom providedByFeature

// an implementation dependency that will be provided by a bundle or wrapped in the OSGi environment
providedByBundle
implementation.extendsFrom providedByBundle

// osgi core dependencies only needed for compiling, they will just be there during runtime
osgiCore
compileOnly.extendsFrom osgiCore

// but we need them in testing
testImplementation.extendsFrom osgiCore
}
}

subprojects {
apply plugin: 'biz.aQute.bnd.builder'
apply plugin: 'java'
apply plugin: 'maven'

sourceCompatibility = 1.8
targetCompatibility = 1.8

test {
exclude '**/*IT.*'
}

task integrationTest(type: Test) {
include '**/*IT.*'
}

// define some Bill of Materials (BOM) for all subprojects
dependencies {
// BOM from Karaf, sets common version for OSGi libraries
bom group: 'org.apache.karaf', name: 'karaf', version: libraryVersions.karaf

// BOM for pax, for jetty, etc.
bom group: 'org.ops4j.pax', name: 'web', version: libraryVersions.pax
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

tasks.withType(Jar) {
jar {
manifest {
// set the vendor
attributes 'Bundle-Vendor': 'Fraunhofer AISEC'

// TODO: this was set in most of the bnd files. do we really need this?
attributes '-noee': true
}
}
}

repositories {
mavenLocal()
mavenCentral()
}
}
15 changes: 15 additions & 0 deletions camel-ids/.classpath
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="target/generated-sources/annotations/" kind="src" path=""/>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path=".apt_generated">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
37 changes: 37 additions & 0 deletions camel-ids/build.gradle
@@ -0,0 +1,37 @@
description = 'Camel IDS Component'

// TODO: these dependencies probably to not match the pom.xml anymore since the restructuring
dependencies {
providedByBundle project(':tpm2j')
providedByBundle project(':ids-api')
providedByBundle project(':ids-comm')

// Bill of Materials (BOM) for Camel
bom group: 'org.apache.camel', name: 'camel-parent', version: libraryVersions.camel

providedByFeature group: 'org.apache.camel', name: 'camel-core'
providedByFeature group: 'org.apache.camel', name: 'camel-ahc'

providedByFeature group: 'org.eclipse.jetty', name: 'jetty-servlet', version: libraryVersions.jetty
providedByFeature group: 'org.eclipse.jetty', name: 'jetty-jmx', version: libraryVersions.jetty
providedByFeature group: 'org.eclipse.jetty', name: 'jetty-servlets', version: libraryVersions.jetty

// TODO: WHY WHY WHY WHY is jetty websocket used, if we already have async http client...
providedByFeature group: 'org.eclipse.jetty.websocket', name: 'websocket-server', version: libraryVersions.jetty
providedByFeature group: 'org.eclipse.jetty.websocket', name: 'websocket-client', version: libraryVersions.jetty

providedByBundle group: 'org.apache.logging.log4j', name: 'log4j-core', version: libraryVersions.log4j

providedByBundle group: 'com.github.jnr', name: 'jnr-unixsocket', version: '0.18'

osgiCore group: 'org.osgi', name: 'org.osgi.compendium', version: libraryVersions.osgiCompendium

providedByFeature group: 'com.google.protobuf', name: 'protobuf-java', version: libraryVersions.protobuf

testImplementation group: 'junit', name: 'junit'
testImplementation group: 'org.apache.camel', name: 'camel-test'
testImplementation group: 'org.mockito', name: 'mockito-all', version: libraryVersions.mockito
}

// integration tests are currently disabled anyway...
//test.dependsOn(startDocker)
7 changes: 0 additions & 7 deletions camel-ids/build.properties

This file was deleted.

Expand Up @@ -26,18 +26,17 @@
import de.fhg.camel.ids.client.WsEndpoint;
import de.fhg.camel.ids.server.WebsocketComponent;
import de.fhg.camel.ids.server.WebsocketComponentServlet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* Main entry point of the Connection Management Layer.
*
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
#Wed Mar 28 18:08:43 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

0 comments on commit aafd018

Please sign in to comment.