| 22426 |
ashik.ali |
1 |
apply plugin: 'java'
|
|
|
2 |
apply plugin: 'maven'
|
|
|
3 |
apply plugin: 'war'
|
| 24313 |
amit.gupta |
4 |
apply plugin: 'eclipse'
|
|
|
5 |
//apply plugin: 'nebula.provided-base'
|
| 22426 |
ashik.ali |
6 |
|
| 24313 |
amit.gupta |
7 |
|
| 22426 |
ashik.ali |
8 |
group = 'com.profitmandi'
|
| 36878 |
aman |
9 |
version = '0.0.1-SNAPSHOT'
|
| 22426 |
ashik.ali |
10 |
|
|
|
11 |
description = """profitmandi-fofo"""
|
|
|
12 |
|
|
|
13 |
sourceCompatibility = 1.8
|
|
|
14 |
targetCompatibility = 1.8
|
| 29901 |
amit.gupta |
15 |
ext['log4j2.version'] = '2.15.0'
|
| 22426 |
ashik.ali |
16 |
|
|
|
17 |
|
|
|
18 |
repositories {
|
| 33258 |
ranu |
19 |
|
|
|
20 |
mavenCentral()
|
|
|
21 |
mavenLocal()
|
| 22426 |
ashik.ali |
22 |
}
|
| 22530 |
ashik.ali |
23 |
|
|
|
24 |
|
| 35433 |
amit |
25 |
task run{
|
| 33265 |
ranu |
26 |
Set environments = ["dev", "staging", "prod"]
|
|
|
27 |
def environment = "dev"
|
| 35433 |
amit |
28 |
if ( project.hasProperty("env") ) {
|
| 33258 |
ranu |
29 |
environment = project.getProperty("env")
|
| 35433 |
amit |
30 |
if(!environments.contains(environment)){
|
| 33258 |
ranu |
31 |
logger.warn("Invalid Environment value, Choose any 'dev', 'staging', 'prod'");
|
|
|
32 |
environment = "dev"
|
|
|
33 |
}
|
| 35433 |
amit |
34 |
}else{
|
| 33258 |
ranu |
35 |
logger.warn("Invalid key")
|
| 22530 |
ashik.ali |
36 |
}
|
| 35433 |
amit |
37 |
ant.propertyfile( file: "src/main/resources/META-INF/env.property"){
|
|
|
38 |
entry( key: "profile", value: environment)
|
| 33265 |
ranu |
39 |
}
|
| 37726 |
amit |
40 |
// Sentry/GlitchTip reports ONLY from a deliberate staging/prod build, and is
|
|
|
41 |
// labelled with that environment. A plain local build leaves the committed
|
|
|
42 |
// enabled=false in place, so a developer's laptop cannot post to the live board.
|
|
|
43 |
ant.propertyfile( file: "src/main/resources/sentry.properties"){
|
|
|
44 |
entry( key: "enabled", value: (environment == "dev" ? "false" : "true"))
|
|
|
45 |
entry( key: "environment", value: environment)
|
|
|
46 |
}
|
| 35433 |
amit |
47 |
logger.warn("Build is being build by "+environment)
|
| 22530 |
ashik.ali |
48 |
}
|
|
|
49 |
|
| 35433 |
amit |
50 |
tasks.build.doLast(){
|
|
|
51 |
ant.propertyfile( file: "src/main/resources/META-INF/env.property"){
|
|
|
52 |
entry( key: "profile", value: "dev")
|
| 33265 |
ranu |
53 |
}
|
| 37726 |
amit |
54 |
ant.propertyfile( file: "src/main/resources/sentry.properties"){
|
|
|
55 |
entry( key: "enabled", value: "false")
|
|
|
56 |
entry( key: "environment", value: "dev")
|
|
|
57 |
}
|
| 22530 |
ashik.ali |
58 |
}
|
|
|
59 |
|
| 22426 |
ashik.ali |
60 |
dependencies {
|
| 37491 |
amit |
61 |
// Ships ERROR-level log events to GlitchTip (self-hosted, Sentry protocol).
|
|
|
62 |
// Pinned to 7.x: 8.x drops Java 8. Verified class major version 52.
|
|
|
63 |
implementation 'io.sentry:sentry-log4j2:7.22.6'
|
|
|
64 |
|
| 35433 |
amit |
65 |
compile project (':profitmandi-common')
|
|
|
66 |
compile project (':profitmandi-dao')
|
| 30471 |
amit.gupta |
67 |
|
| 37337 |
amit |
68 |
// PDF table extraction for the Pine Labs affordability circular. Lives here because
|
|
|
69 |
// the parse now runs in this application rather than in profitmandi-cron; keep it
|
|
|
70 |
// out of profitmandi-common, or PDFBox reaches the web WAR too (common deliberately
|
|
|
71 |
// keeps pdfbox at test scope).
|
|
|
72 |
// - bouncycastle is only for encrypted PDFs (ours are not) and its
|
|
|
73 |
// bcprov-jdk15on:1.69 clashes with the bcprov already on this classpath
|
|
|
74 |
// - slf4j-simple would bind as a second SLF4J provider against log4j2
|
|
|
75 |
// - jai-imageio is image decoding; we read text and rulings only
|
|
|
76 |
implementation('technology.tabula:tabula:1.0.5') {
|
|
|
77 |
exclude group: 'org.bouncycastle'
|
|
|
78 |
exclude group: 'org.slf4j', module: 'slf4j-simple'
|
|
|
79 |
exclude group: 'com.github.jai-imageio'
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
|
| 35433 |
amit |
83 |
compile(group: 'org.apache.velocity', name: 'velocity-tools', version: '1.3') {
|
| 33265 |
ranu |
84 |
exclude(module: 'commons-logging')
|
|
|
85 |
exclude(module: 'commons-digester')
|
|
|
86 |
//exclude(module: 'commons-collections')
|
|
|
87 |
exclude(module: 'dom4j')
|
|
|
88 |
exclude(module: 'antlr')
|
|
|
89 |
exclude(module: 'velocity')
|
| 30471 |
amit.gupta |
90 |
|
| 33265 |
ranu |
91 |
}
|
| 33258 |
ranu |
92 |
compile 'com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6'
|
|
|
93 |
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6:'
|
| 33265 |
ranu |
94 |
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6'
|
|
|
95 |
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.5'
|
|
|
96 |
compile 'org.apache.poi:poi-ooxml:3.16'
|
| 34687 |
amit.gupta |
97 |
// Add HikariCP dependency
|
|
|
98 |
implementation 'com.zaxxer:HikariCP:3.4.5' // Use the latest version
|
| 35433 |
amit |
99 |
// https://mvnrepository.com/artifact/org.xhtmlrenderer/core-renderer
|
|
|
100 |
compile (group: 'org.xhtmlrenderer', name: 'core-renderer', version: 'R8') {
|
|
|
101 |
exclude(module : 'bcprov-jdk14')
|
|
|
102 |
}
|
| 29901 |
amit.gupta |
103 |
|
| 35433 |
amit |
104 |
|
|
|
105 |
|
|
|
106 |
|
| 22860 |
ashik.ali |
107 |
testCompile "junit:junit:4.12"
|
| 33265 |
ranu |
108 |
//provided 'org.projectlombok:lombok:1.18.2'
|
| 35879 |
ranu |
109 |
|
|
|
110 |
// Selenium for Knowlarity scraping (Java 8 compatible versions)
|
| 22426 |
ashik.ali |
111 |
}
|
| 22860 |
ashik.ali |
112 |
|
|
|
113 |
test {
|
|
|
114 |
testLogging.showStandardStreams = true
|
| 23114 |
ashik.ali |
115 |
// for enable or disable test cases
|
| 33258 |
ranu |
116 |
|
| 23175 |
ashik.ali |
117 |
exclude 'com/spice/profitmandi/service/generic/GenericServiceTest.class'
|
| 33265 |
ranu |
118 |
}
|
| 37337 |
amit |
119 |
|
|
|
120 |
// Writes this module's runtime classpath to build/circular-classpath.txt so the
|
|
|
121 |
// offer-circular ingest can be driven locally outside Spring - see
|
|
|
122 |
// scripts/offer_circular/README.md ("Running and measuring an ingest locally").
|
|
|
123 |
// Lives here now that the parser does; it used to sit in profitmandi-cron.
|
|
|
124 |
task dumpCircularClasspath {
|
|
|
125 |
doLast {
|
|
|
126 |
new File("$buildDir/circular-classpath.txt").text =
|
|
|
127 |
sourceSets.main.runtimeClasspath.asPath
|
|
|
128 |
}
|
|
|
129 |
}
|