-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
151 lines (123 loc) · 5.45 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-tomcat-plugin:2.7.0'
}
}
apply plugin: 'com.bmuschko.tomcat'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven-publish'
// define the version for the project when publishing to maven
group "blackboard.plugin"
version "2022.02.061-SNAPSHOT"
project.ext {
learnVersion = "3900.54.0"
springVersion = "5.3.25"
// hibernateVersion = "4.1.10.Final"
}
description = """bblogbackb2"""
// sourceCompatibility = 1.6
// targetCompatibility = 1.6
def logbackVersion = '1.0.13'
def logbackClassic = "ch.qos.logback:logback-classic:${logbackVersion}"
def logbackCore = "ch.qos.logback:logback-core:${logbackVersion}"
def slf4jVersion = '1.6.6'
def slf4jAPI = "org.slf4j:slf4j-api:${slf4jVersion}"
def slf4jJCL = "org.slf4j:jcl-over-slf4j:${slf4jVersion}"
// mbk - We no longer user slf4jLog4J. References have been commented out.
// We're using logback. Having both in here caused a multiple bindings warning.
// On Learn 3000. and earlier the logback logger was choosen by the runtime.
// But on 3100 and later it wasn't and we didn't get in a logs, because
// this code does all logging using logback!
def slf4jLog4J = "org.slf4j:slf4j-log4j12:${slf4jVersion}"
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://maven.blackboard.com/content/repositories/releases/" }
mavenCentral()
}
// for the b2deploy task defined later.
configurations {
buildUtils
}
// Configure so that at run-time the compiled jsp java is used.
tomcat {
jasper {
validateTld = false
webXmlFragment = file("$webAppDir/WEB-INF/generated_web.xml")
addWebXmlMappings = true
}
}
dependencies {
// Pre-compile jsp Dependencies. tomcatVersion 8.5.4 is not available as of this writing
def tomcatVersion = '8.5.0'
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
"org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
"org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}",
"blackboard.platform:bb-taglibs:$project.ext.learnVersion",
"blackboard.platform:bb-platform:$project.ext.learnVersion",
"blackboard.platform:bb-bbxythos:$project.ext.learnVersion",
"javax.servlet:jstl:1.2"
providedCompile "javax.servlet:servlet-api:2.5"
// Blackboard Dependencies
// providedCompile dependencies are libraries needed to build, but should not be included in the B2 WAR.
// You should NEVER include Learn JARs (other than webapis) in your B2.
providedCompile( "blackboard.platform:bb-platform:$project.ext.learnVersion" ) { transitive = false }
providedCompile( "blackboard.platform:bb-bbxythos:$project.ext.learnVersion" ) { transitive = false }
providedCompile( "blackboard.platform:bb-taglibs:$project.ext.learnVersion" ) { transitive = false }
// Spring Dependencies
implementation(group: 'org.springframework', name: 'spring-context', version:'5.3.25') {
exclude(module: 'commons-logging')
implementation group: 'com.google.guava', name: 'guava', version: '15.0'
}
implementation(logbackClassic)
implementation(logbackCore)
implementation(slf4jAPI)
implementation(slf4jJCL)
// implementation(slf4jLog4J)
implementation group: 'org.springframework', name: 'spring-webmvc', version:'5.3.25'
implementation group: 'org.aspectj', name: 'aspectjrt', version:'1.6.10'
// implementation group: 'org.slf4j', name: 'slf4j-api', version:'1.6.6'
implementation group: 'javax.inject', name: 'javax.inject', version:'1'
implementation group: 'javax.servlet', name: 'jstl', version:'1.2'
// runtimeOnly group: 'org.slf4j', name: 'jcl-over-slf4j', version:'1.6.6'
// runtimeOnly group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.6.6'
// runtimeOnly(group: 'log4j', name: 'log4j', version:'1.2.15') {
// exclude(module: 'mail')
// exclude(module: 'jms')
// exclude(module: 'jmxtools')
// exclude(module: 'jmxri')
// }
testImplementation group: 'junit', name: 'junit', version:'4.7'
providedCompile group: 'javax.servlet', name: 'servlet-api', version:'2.5'
providedCompile group: 'javax.servlet.jsp', name: 'jsp-api', version:'2.1'
// A couple more Blackboard items...
runtimeOnly "org.javassist:javassist:3.17.1-GA", "dom4j:dom4j:1.6.1"
buildUtils "org.oscelot:b2deploy-task:0.1.0"
} // END dependencies
// Add a task to deploy a B2 using starting block
task deployB2( dependsOn: "war" ) doLast {
ant.taskdef( name: "b2deploy", classname: "org.oscelot.ant.B2DeployTask", classpath: project.configurations.buildUtils.asPath )
ant.b2deploy( localfilepath: project.war.archivePath, host: System.getProperty("server"), courseorgavailable: 'true', clean: 'true' )
}
// This task runs the build script that compiles jsp pages on build.
task compileJsps(type: JavaCompile) {
group = 'build'
description = 'Translates and compiles JSPs'
classpath = configurations.tomcat + sourceSets.main.output + sourceSets.main.runtimeClasspath
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
destinationDir = file("src/main/webapp/WEB-INF/classes")
source = file("build/jasper/org/apache/jsp")
dependsOn classes
dependsOn tomcatJasper
}
task wrapit(type: Wrapper) {
gradleVersion = '7.6'
}
// To build our war we use the compileJsps task
war.dependsOn compileJsps