From 5b40acdc529fdb9498fd2e3e85498212caef9f3a Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 14 Sep 2016 11:05:31 +0000 Subject: [PATCH 1/7] disable gradle deamon Original commit: elastic/x-pack-elasticsearch@f93c69bf4044d136cfc2dd15c5d99cb723862644 --- gradle.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 gradle.properties diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000000..6b1823d86a6 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.daemon=false From f367ecf1e24870c2d18ca6f9831c3c51d95add23 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Fri, 16 Sep 2016 17:30:45 +0100 Subject: [PATCH 2/7] Build Native C++ binaries and Java code in a single gradle project. C++ is built by calling make Original commit: elastic/x-pack-elasticsearch@bd52bfd316438b9f3df3db49ad34a966ad016a7d --- build.gradle | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 17 ++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 build.gradle create mode 100644 settings.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000000..554e4a46ad9 --- /dev/null +++ b/build.gradle @@ -0,0 +1,52 @@ +description = 'Builds the Prelert Engine native binaries and Java classes' + +project.ext.numCpus = Runtime.runtime.availableProcessors() -1 + + +task clean(type: Exec) { + commandLine 'make' + args 'clean', 'BUILD_ENGINE_API=1' +} + +task objcompile(type: Exec) { + commandLine 'make' + args '-j' + numCpus, 'objcompile', 'BUILD_ENGINE_API=1' +} + +task make(type: Exec) { + commandLine 'make' + args '-j' + numCpus, 'BUILD_ENGINE_API=1' +} + +task test(type: Exec) { + commandLine 'make' + args '-j' + numCpus, 'BUILD_ENGINE_API=1', 'test' +} + +subprojects { + apply plugin: 'maven' + apply plugin: 'java' + + group = 'com.prelert' + version = '2.1.1' + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + + + repositories { + mavenLocal() + maven { url "http://repo.maven.apache.org/maven2" } + } + + configurations.all { + } + + dependencies { + compile group: 'log4j', name: 'log4j', version:'1.2.17' + testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3' + testCompile group: 'junit', name: 'junit', version:'4.11' + testCompile group: 'org.ini4j', name: 'ini4j', version:'0.5.2' + testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19' + } +} + diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000000..91ed0e442ac --- /dev/null +++ b/settings.gradle @@ -0,0 +1,17 @@ +rootProject.name = 'prelert-engine-api' +include ':engine-api-java' +include ':prelert-engine-api-common' +include ':data-extractors' +include ':engine-api' +include ':prelert-engine-api-client' +include ':engine-api-server' +include ':elasticsearch-persistence' + +project(':engine-api-java').projectDir = "$rootDir/java/apps/engineApi" as File +project(':prelert-engine-api-common').projectDir = "$rootDir/java/apps/engineApi/api-common" as File +project(':data-extractors').projectDir = "$rootDir/java/apps/engineApi/data-extractors" as File +project(':engine-api').projectDir = "$rootDir/java/apps/engineApi/engine-api" as File +project(':prelert-engine-api-client').projectDir = "$rootDir/java/apps/engineApi/apiClient" as File +project(':engine-api-server').projectDir = "$rootDir/java/apps/engineApi/apiServer" as File +project(':elasticsearch-persistence').projectDir = "$rootDir/java/apps/engineApi/elasticsearch-persistence" as File + From c0b1ac948c91499a21372d7eae6007a40cacb7f0 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Mon, 19 Sep 2016 14:08:35 +0100 Subject: [PATCH 3/7] More Gradle migration changes Original commit: elastic/x-pack-elasticsearch@2cdd8252246f340b4ad91ae02fc4cd288784f9ea --- build.gradle | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 554e4a46ad9..dd94dad7368 100644 --- a/build.gradle +++ b/build.gradle @@ -1,26 +1,28 @@ description = 'Builds the Prelert Engine native binaries and Java classes' -project.ext.numCpus = Runtime.runtime.availableProcessors() -1 +import org.gradle.internal.os.OperatingSystem +project.ext.make = OperatingSystem.current().isLinux() ? "make" : "gnumake" +project.ext.numCpus = Runtime.runtime.availableProcessors() task clean(type: Exec) { - commandLine 'make' - args 'clean', 'BUILD_ENGINE_API=1' + commandLine make + args 'clean' } task objcompile(type: Exec) { - commandLine 'make' - args '-j' + numCpus, 'objcompile', 'BUILD_ENGINE_API=1' + commandLine make + args '-j' + numCpus, 'objcompile' } task make(type: Exec) { - commandLine 'make' - args '-j' + numCpus, 'BUILD_ENGINE_API=1' + commandLine make + args '-j' + numCpus } -task test(type: Exec) { - commandLine 'make' - args '-j' + numCpus, 'BUILD_ENGINE_API=1', 'test' +task cpptest(type: Exec) { + commandLine make + args '-j' + numCpus, 'test' } subprojects { From 1b667b2584955ab38197d5c854176c7a75a8c05e Mon Sep 17 00:00:00 2001 From: David Roberts Date: Mon, 19 Sep 2016 14:36:40 +0100 Subject: [PATCH 4/7] Further split out C++ Gradle targets to make life easier for people without a C++ build environment Original commit: elastic/x-pack-elasticsearch@eeca100a3b8f418340f19af11d65c53c235d6d90 --- build.gradle | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index dd94dad7368..38313bef07f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,17 +5,17 @@ import org.gradle.internal.os.OperatingSystem project.ext.make = OperatingSystem.current().isLinux() ? "make" : "gnumake" project.ext.numCpus = Runtime.runtime.availableProcessors() -task clean(type: Exec) { +task cppclean(type: Exec) { commandLine make args 'clean' } -task objcompile(type: Exec) { +task cppobjcompile(type: Exec) { commandLine make args '-j' + numCpus, 'objcompile' } -task make(type: Exec) { +task cppmake(type: Exec) { commandLine make args '-j' + numCpus } @@ -29,6 +29,8 @@ subprojects { apply plugin: 'maven' apply plugin: 'java' + compileJava.options.encoding = 'UTF-8' + group = 'com.prelert' version = '2.1.1' sourceCompatibility = 1.8 From f37a86c8803f9c0fc488da786ff0bc8a92a66a5f Mon Sep 17 00:00:00 2001 From: David Roberts Date: Mon, 19 Sep 2016 15:00:38 +0100 Subject: [PATCH 5/7] Explicitly state source code encoding is UTF-8 in Gradle build files Original commit: elastic/x-pack-elasticsearch@2f59b2c3a9f619956d73f1d5416d24e6f2ffdd1c --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 38313bef07f..7ea11eeb760 100644 --- a/build.gradle +++ b/build.gradle @@ -30,13 +30,13 @@ subprojects { apply plugin: 'java' compileJava.options.encoding = 'UTF-8' + compileTestJava.options.encoding = 'UTF-8' group = 'com.prelert' version = '2.1.1' sourceCompatibility = 1.8 targetCompatibility = 1.8 - repositories { mavenLocal() maven { url "http://repo.maven.apache.org/maven2" } From b991b34f0e9d2a0f6c798506ed1d128a46c08f2e Mon Sep 17 00:00:00 2001 From: David Kyle Date: Mon, 19 Sep 2016 16:23:45 +0100 Subject: [PATCH 6/7] Add engine-node project to the root gradle project Builds the classes etc but does not copy any artefacts to the build area as the other projects do Original commit: elastic/x-pack-elasticsearch@abc1301c7048e9a9255e19d8483d83eceed0cd9b --- settings.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 91ed0e442ac..7b98a0a82d0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,6 +6,7 @@ include ':engine-api' include ':prelert-engine-api-client' include ':engine-api-server' include ':elasticsearch-persistence' +include ':engine-node' project(':engine-api-java').projectDir = "$rootDir/java/apps/engineApi" as File project(':prelert-engine-api-common').projectDir = "$rootDir/java/apps/engineApi/api-common" as File @@ -14,4 +15,4 @@ project(':engine-api').projectDir = "$rootDir/java/apps/engineApi/engine-api" as project(':prelert-engine-api-client').projectDir = "$rootDir/java/apps/engineApi/apiClient" as File project(':engine-api-server').projectDir = "$rootDir/java/apps/engineApi/apiServer" as File project(':elasticsearch-persistence').projectDir = "$rootDir/java/apps/engineApi/elasticsearch-persistence" as File - +project(':engine-node').projectDir = "$rootDir/java/apps/engine-node" as File From 2d7b536848381b43224c2141ebb422c5821bc84c Mon Sep 17 00:00:00 2001 From: David Roberts Date: Tue, 20 Sep 2016 15:07:14 +0100 Subject: [PATCH 7/7] Updating version number Original commit: elastic/x-pack-elasticsearch@6427ca02555ed7a8b6520bb7098081a8c4b567dd --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7ea11eeb760..36ccc81ba8c 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ subprojects { compileTestJava.options.encoding = 'UTF-8' group = 'com.prelert' - version = '2.1.1' + version = '2.2.0' sourceCompatibility = 1.8 targetCompatibility = 1.8