1+ // Prevents IntelliJ from reporting some warnings that seem to be no real problem
2+ // file:noinspection GroovyAccessibility
3+ // file:noinspection GroovyAssignabilityCheck
4+
5+ plugins {
6+ id ' java'
7+ }
8+
9+ group ' com.nuix'
10+ version ' 9.6.5.283'
11+
12+ repositories {
13+ mavenCentral()
14+ flatDir { dirs ' engine/lib' }
15+ }
16+
17+ dependencies {
18+ testImplementation ' org.junit.jupiter:junit-jupiter-api:5.8.2'
19+ testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine:5.8.2'
20+
21+ // Used for logging
22+ implementation ' org.apache.logging.log4j:log4j-api:2.17.1'
23+ implementation ' org.apache.logging.log4j:log4j-core:2.17.1'
24+
25+ // Required for various date objects
26+ implementation ' joda-time:joda-time:2.10.13'
27+
28+ // Reference Nuix dependencies
29+ implementation fileTree(dir : ' engine/lib' , include : ' nuix-scripting*.jar' )
30+ implementation fileTree(dir : ' engine/lib' , include : ' nuix-engine*.jar' )
31+ runtimeOnly fileTree(dir : ' engine/lib' , include : ' *.jar' )
32+ }
33+
34+ java {
35+ toolchain {
36+ languageVersion = JavaLanguageVersion . of(11 )
37+ }
38+ }
39+
40+ // Here we define the location of some key directories so we can make
41+ // consistent references to them throughout the rest of this file
42+ String engineDirectory = rootProject. rootDir. getAbsolutePath() + " \\ engine"
43+ String engineBinDirectory = engineDirectory + " \\ bin"
44+ String engineX86BinDirectory = engineDirectory + " \\ bin\\ x86"
45+ String rootLogDir = rootProject. rootDir. getAbsolutePath() + " \\ logs"
46+ String envPath = engineBinDirectory + " ;" + engineX86BinDirectory
47+
48+ def defaultJvmArgs = [
49+ // Necessary for newer versions of Nuix. Without this you will likely see
50+ // an error regarding loading the BouncyCastle crypto library at run-time
51+ " --add-exports=java.base/jdk.internal.loader=ALL-UNNAMED" ,
52+
53+ // This will be passed to EngineWrapper on creation allowing it to resolve
54+ // all the dependencies in an engine release
55+ " -Dnuix.engineDir=\" ${ engineDirectory} \" " ,
56+
57+ // Provided to EngineWrapper to specify the root directory where logs will be written
58+ " -Dnuix.logDir=\" ${ rootLogDir} \" " ,
59+
60+ // Specify a temp directory accessible to the user running our code
61+ " -Djava.io.tmpdir=\" ${ System.getenv("LOCALAPPDATA")} \\ Temp\\ Nuix\" " ,
62+ ]
63+
64+ task BasicInitialization (type : JavaExec ) {
65+ classpath sourceSets. main. runtimeClasspath
66+ group = " Examples"
67+ mainClass = " com.nuix.javaenginesimple.examples.BasicInitializationExample"
68+ jvmArgs = defaultJvmArgs
69+ setEnvironment([" PATH" :envPath])
70+ }
71+
72+ task CreateSimpleCase (type : JavaExec ) {
73+ classpath sourceSets. main. runtimeClasspath
74+ group = " Examples"
75+ mainClass = " com.nuix.javaenginesimple.examples.CreateSimpleCaseExample"
76+ jvmArgs = defaultJvmArgs
77+ setEnvironment([" PATH" :envPath])
78+ }
79+
80+ task OpenCase (type : JavaExec ) {
81+ classpath sourceSets. main. runtimeClasspath
82+ group = " Examples"
83+ mainClass = " com.nuix.javaenginesimple.examples.OpenCaseExample"
84+ jvmArgs = defaultJvmArgs
85+ setEnvironment([" PATH" :envPath])
86+ }
87+
88+ task BasicSearchAndTag (type : JavaExec ) {
89+ classpath sourceSets. main. runtimeClasspath
90+ group = " Examples"
91+ mainClass = " com.nuix.javaenginesimple.examples.BasicSearchAndTagExample"
92+ jvmArgs = defaultJvmArgs
93+ setEnvironment([" PATH" :envPath])
94+ }
95+
96+ task BasicExport (type : JavaExec ) {
97+ classpath sourceSets. main. runtimeClasspath
98+ group = " Examples"
99+ mainClass = " com.nuix.javaenginesimple.examples.BasicExportExample"
100+ jvmArgs = defaultJvmArgs
101+ setEnvironment([" PATH" :envPath])
102+ }
103+
104+ task CreateProductionSet (type : JavaExec ) {
105+ classpath sourceSets. main. runtimeClasspath
106+ group = " Examples"
107+ mainClass = " com.nuix.javaenginesimple.examples.CreateProductionSetExample"
108+ jvmArgs = defaultJvmArgs
109+ setEnvironment([" PATH" :envPath])
110+ }
111+
112+ task IntermediateSearchAndTag (type : JavaExec ) {
113+ classpath sourceSets. main. runtimeClasspath
114+ group = " Examples"
115+ mainClass = " com.nuix.javaenginesimple.examples.IntermediateSearchAndTagExample"
116+ jvmArgs = defaultJvmArgs
117+ setEnvironment([" PATH" :envPath])
118+ }
119+
120+ task LoadDataIntoCase (type : JavaExec ) {
121+ classpath sourceSets. main. runtimeClasspath
122+ group = " Examples"
123+ mainClass = " com.nuix.javaenginesimple.examples.LoadDataIntoCaseExample"
124+ jvmArgs = defaultJvmArgs
125+ setEnvironment([" PATH" :envPath])
126+ }
127+
128+ task RevealDecryptionPassword (type : JavaExec ) {
129+ classpath sourceSets. main. runtimeClasspath
130+ group = " Examples"
131+ mainClass = " com.nuix.javaenginesimple.examples.RevealDecryptionPasswordExample"
132+ jvmArgs = defaultJvmArgs
133+ setEnvironment([" PATH" :envPath])
134+ }
135+
136+ task UsingText (type : JavaExec ) {
137+ classpath sourceSets. main. runtimeClasspath
138+ group = " Examples"
139+ mainClass = " com.nuix.javaenginesimple.examples.UsingTextExample"
140+ jvmArgs = defaultJvmArgs
141+ setEnvironment([" PATH" :envPath])
142+ }
143+
144+ // Slight modification to javadoc task provided by Java plugin to change output directory
145+ javadoc {
146+ destinationDir = new File (rootProject. rootDir. getAbsolutePath() + " \\ ..\\ docs" )
147+ }
148+
149+ test {
150+ useJUnitPlatform()
151+ }
0 commit comments