forked from TheCoder4eu/BootsFacesWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
107 lines (93 loc) · 4.01 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
apply plugin: 'java'
apply plugin: 'war'
//webAppDirName = 'web'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenLocal()
mavenCentral()
}
//sourceSets {
// main {
// java {
// srcDir 'src/java'
// }
// }
//}
dependencies {
providedCompile 'javax.enterprise:cdi-api:1.2'
providedCompile 'javax.servlet:javax.servlet-api:3.0.+'
providedCompile 'com.sun.faces:jsf-api:2.2.+'
providedCompile 'com.sun.faces:jsf-impl:2.2.+'
providedCompile 'org.glassfish.web:el-impl:2.2'
providedCompile 'javax.validation:validation-api:1.0.0.GA'
compile 'org.hibernate:hibernate-validator:5.2.2.Final'
compile 'org.primefaces:primefaces:6.1'
compile 'net.glxn:qrgen:1.4'
compile 'net.sf.barcode4j:barcode4j-light:2.0'
compile 'com.google.zxing:core:3.1.0'
compile 'com.google.zxing:javase:3.1.0'
compile 'org.omnifaces:omnifaces:2.6.1'
//compile 'de.larmic.butterfaces:components:1.10.3'
compile 'org.highfaces:highfaces:1.2'
compile files("${System.properties['java.home']}/../lib/tools.jar")
compile fileTree(dir: 'bsflib', include: '*.jar') //Required for messages/utils
compile "net.bootsfaces:bootsfaces:1.3.0"
}
war.doFirst {
String emptyPage="${webAppDir}/empty.xhtml"
String indexPage="${webAppDir}/index.xhtml"
String contents = new File( emptyPage ).getText( 'UTF-8' )
//Replace the text
contents = contents.replaceAll( 'Title', 'BootsFaces Showcase' )
Date buildDate = new Date()
String hostname= InetAddress.getLocalHost().getHostName()
String currentJvm = org.gradle.internal.jvm.Jvm.current()
String dependencies="";
try {
// eachDependency { DependencyResolveDetails details ->
// dependencies +="${details.requested.group}:${details.requested.name}:${details.requested.version}"
// }
def compileConfiguration = project.configurations.getByName("compile")
def resolvedConfiguration = compileConfiguration.resolvedConfiguration
def resolvedArtifacts = resolvedConfiguration.resolvedArtifacts
resolvedArtifacts.each { dp ->
dependencies += "${dp.name}<br/>"
}
} catch (Exception e) {
dependencies = "Couldn't resolve the dependencies: $e"
}
String currentOS = System.properties['os.name']+' '+System.properties['os.version']+' '+System.properties['os.arch']
String buildInfo = """\n\
<b:row>
<b:jumbotron>
<img src="https://www.bootsfaces.net/img/bsf_logo.png"/>
<p>Welcome to the BootsFaces Showcase and Documentation</p>
<p><b:navLink value="BootsFaces License" outcome="license" iconAwesome="gavel"/></p>
<b:button iconAwesome="info" pt:data-target="#infomodal" pt:data-toggle="modal" onclick="return false;" size="xs" value="" styleClass="pull-right"/>
</b:jumbotron>
</b:row>
<b:modal id="infomodal" title="Application Build Informations">
<b:panel title="Build Informations" look="info">
Built on $hostname $currentOS<br/>
by Gradle ${project.gradle.gradleVersion}<br/>
Java Version $currentJvm<br/>
sourceCompatibility $sourceCompatibility<br/>
targetCompatibility $targetCompatibility<br/>
Build Date ${buildDate}<br/>
</b:panel>
<b:panel title="Libraries used in the demo" look="info">
$dependencies
</b:panel>\n\
<f:facet name="footer">
<b:button value="close" dismiss="modal" onclick="return false;"/>
</f:facet>
</b:modal>
"""
contents = contents.replaceAll( '</h1>', '</h1>'+buildInfo )
new File( indexPage ).write( contents, 'UTF-8' )
}
war {
archiveName = 'BootsFacesWeb.war'
// classpath fileTree(dir: 'bsflib', include: '*') // adds a file-set to the WEB-INF/lib dir.
}