Subversion Repositories SmartDukaan

Rev

Rev 37685 | Blame | Compare with Previous | Last modification | View Log | RSS feed

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: 'eclipse'
//apply plugin: 'nebula.provided-base'


group = 'com.profitmandi'
version = '0.0.1-SNAPSHOT'

description = """profitmandi-fofo"""

sourceCompatibility = 1.8
targetCompatibility = 1.8
ext['log4j2.version'] = '2.15.0'


repositories {

    mavenCentral()
    mavenLocal()
}


task run{
    Set environments = ["dev", "staging", "prod"]
    def environment = "dev"
    if ( project.hasProperty("env") ) {
        environment = project.getProperty("env")
        if(!environments.contains(environment)){
            logger.warn("Invalid Environment value, Choose any 'dev', 'staging', 'prod'");
            environment = "dev"
        }
    }else{
        logger.warn("Invalid key")
    }
    ant.propertyfile( file: "src/main/resources/META-INF/env.property"){
        entry( key: "profile", value: environment)
    }
    // Sentry/GlitchTip reports ONLY from a deliberate staging/prod build, and is
    // labelled with that environment. A plain local build leaves the committed
    // enabled=false in place, so a developer's laptop cannot post to the live board.
    ant.propertyfile( file: "src/main/resources/sentry.properties"){
        entry( key: "enabled", value: (environment == "dev" ? "false" : "true"))
        entry( key: "environment", value: environment)
    }
    logger.warn("Build is being build by "+environment)
}

tasks.build.doLast(){
    ant.propertyfile( file: "src/main/resources/META-INF/env.property"){
        entry( key: "profile", value: "dev")
    }
    ant.propertyfile( file: "src/main/resources/sentry.properties"){
        entry( key: "enabled", value: "false")
        entry( key: "environment", value: "dev")
    }
}

dependencies {
    // Ships ERROR-level log events to GlitchTip (self-hosted, Sentry protocol).
    // Pinned to 7.x: 8.x drops Java 8. Verified class major version 52.
    implementation 'io.sentry:sentry-log4j2:7.22.6'

    compile project (':profitmandi-common')
    compile project (':profitmandi-dao')

    // PDF table extraction for the Pine Labs affordability circular. Lives here because
    // the parse now runs in this application rather than in profitmandi-cron; keep it
    // out of profitmandi-common, or PDFBox reaches the web WAR too (common deliberately
    // keeps pdfbox at test scope).
    //   - bouncycastle is only for encrypted PDFs (ours are not) and its
    //     bcprov-jdk15on:1.69 clashes with the bcprov already on this classpath
    //   - slf4j-simple would bind as a second SLF4J provider against log4j2
    //   - jai-imageio is image decoding; we read text and rulings only
    implementation('technology.tabula:tabula:1.0.5') {
        exclude group: 'org.bouncycastle'
        exclude group: 'org.slf4j', module: 'slf4j-simple'
        exclude group: 'com.github.jai-imageio'
    }


    compile(group: 'org.apache.velocity', name: 'velocity-tools', version: '1.3') {
        exclude(module: 'commons-logging')
        exclude(module: 'commons-digester')
        //exclude(module: 'commons-collections')
        exclude(module: 'dom4j')
        exclude(module: 'antlr')
        exclude(module: 'velocity')

    }
    compile 'com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6'
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6:'
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6'
    compile group: 'org.apache.commons', name: 'commons-csv', version: '1.5'
    compile 'org.apache.poi:poi-ooxml:3.16'
    // Add HikariCP dependency
    implementation 'com.zaxxer:HikariCP:3.4.5' // Use the latest version
    // https://mvnrepository.com/artifact/org.xhtmlrenderer/core-renderer
    compile (group: 'org.xhtmlrenderer', name: 'core-renderer', version: 'R8') {
        exclude(module : 'bcprov-jdk14')
    }




    testCompile "junit:junit:4.12"
    //provided 'org.projectlombok:lombok:1.18.2'

    // Selenium for Knowlarity scraping (Java 8 compatible versions)
}

test {
    testLogging.showStandardStreams = true
    // for enable or disable test cases

    exclude 'com/spice/profitmandi/service/generic/GenericServiceTest.class'
}

// Writes this module's runtime classpath to build/circular-classpath.txt so the
// offer-circular ingest can be driven locally outside Spring - see
// scripts/offer_circular/README.md ("Running and measuring an ingest locally").
// Lives here now that the parser does; it used to sit in profitmandi-cron.
task dumpCircularClasspath {
    doLast {
        new File("$buildDir/circular-classpath.txt").text =
                sourceSets.main.runtimeClasspath.asPath
    }
}