-
Notifications
You must be signed in to change notification settings - Fork 44
/
build.gradle
115 lines (102 loc) · 4.11 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
buildscript {
dependencies {
classpath group: 'com.liferay', name: 'com.liferay.gradle.plugins.wsdl.builder', version: '3.0.4'
}
repositories {
maven {
url 'https://repository-cdn.liferay.com/nexus/content/groups/public'
}
}
}
apply plugin: 'com.liferay.wsdl.builder'
allprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
version = '1.1.0'
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDir 'build/codegen'
srcDir 'src/main/java'
}
}
}
dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '32.1.3-jre'
implementation group: 'javax.xml', name: 'jaxrpc-api', version: '1.1'
implementation group: 'javax.xml.soap', name: 'javax.xml.soap-api', version: '1.4.0'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.13'
implementation group: 'org.apache.logging.log4j', name: 'log4j', version: '2.23.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.23.1'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.17.0'
implementation group: 'commons-discovery', name: 'commons-discovery', version: '0.5'
implementation group: 'org.apache.axis', name: 'axis', version: '1.4'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.3.2'
implementation group: 'wsdl4j', name: 'wsdl4j', version: '1.6.3'
implementation group: 'net.sf.jpf', name: 'jpf', version: '1.5'
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '2.0.13'
implementation fileTree(dir: '../Platform/Plugins/com.tle.platform.common/target/scala-2.13', include: ['*.jar'])
implementation fileTree(dir: '../Source/Plugins/Platform/com.tle.platform.swing/target/scala-2.13', include: ['*.jar'])
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}
}
subprojects {
apply plugin: 'application'
}
task importToolJar(type: Jar, description: 'Create a fat JAR for Import Tool') {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName.set('import-tool')
manifest {
attributes('Main-Class': 'com.dytech.edge.importexport.importutil.ImportUtility',
'Implementation-Title': 'import-tool',
'Implementation-Version': archiveVersion
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
task exportToolJar(type: Jar, description: 'Create a fat JAR for Export Tool') {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName.set('export-tool')
manifest {
attributes('Main-Class': 'com.dytech.edge.importexport.exportutil.ExportUtility',
'Implementation-Title': 'export-tool',
'Implementation-Version': archiveVersion
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
task createImportExportTools(dependsOn: [importToolJar,exportToolJar], description: 'Create fat JARs for both Import and Export Tool' ) {
doLast {
println "Import and export tools are created under $projectDir/build/libs"
}
}
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
task compileSbtProject(type: Exec, description: 'Assemble sbt dependencies') {
def commands = ['./sbt','com_tle_platform_swing/assembly','com_tle_platform_common/assembly']
if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
commands.addAll(0, ['cmd', '/c'])
}
//sbt assembly is only available when called from sbt root project
workingDir '../'
commandLine commands as Object[]
}
// buildWSDL is a task provided by plugin: "com.liferay.wsdl.builder"
buildWSDL {
destinationDir = file('build/codegen')
generateOptions.mappings = ['http://soap.remoting.web.tle.com': 'com.tle.web.remoting.soap', 'http://lang.java': 'com.tle.web.remoting.exception']
buildLibs = false
includeWSDLs = false
}
//We do not need the jar task executed to create a jar of the whole project so disable it
jar.enabled = false
compileJava.dependsOn([buildWSDL,compileSbtProject] as Object[])
assemble.finalizedBy(createImportExportTools)