Revision a221c0506fb2447d8e3a42af759cb10b85b364dc authored by Vyacheslav Zholudev on 22 September 2017, 15:09:30 UTC, committed by Vyacheslav Zholudev on 22 September 2017, 15:09:42 UTC

Former-commit-id: 25ea83b1616a75e45f8d83ef36efaad02322830b
1 parent bc8380d
Raw File
build.gradle
buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath group: 'net.researchgate', name: 'gradle-release', version: '2.4.0'
        classpath 'net.saliman:gradle-cobertura-plugin:2.5.0'
    }
}

plugins {
    id 'net.saliman.cobertura' version '2.5.0'
    id 'com.github.kt3k.coveralls' version '2.8.1'
}

cobertura.coverageFormats = ['html', 'xml']

/*plugins {
    id 'jacoco'
    id 'com.github.kt3k.coveralls' version '2.6.3'
}*/

//<====== Fixing cobertura dependency
repositories {
    mavenCentral()
}

allprojects {
    apply plugin: 'maven'
    apply plugin: 'java'
    apply plugin: 'net.researchgate.release'

    group = "org.grobid"
}

subprojects {
    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    repositories {
        mavenCentral()
        jcenter()
        repositories {
            maven {
                url new File(rootProject.rootDir, "grobid-core/lib")
            }
        }
    }

    configurations {
        all*.exclude group: 'org.slf4j', module: "slf4j-jdk14"
        all*.exclude group: 'org.slf4j', module: "slf4j-log4j12"
        all*.exclude group: 'log4j', module: "log4j"
        all*.exclude module: 'slf4j-jdk14'
    }

    dependencies {
        testCompile "junit:junit:4.12"
        testCompile "org.easymock:easymock:3.4"
        testCompile "org.powermock:powermock-api-easymock:1.6.6"
        testCompile "org.powermock:powermock-module-junit4:1.6.6"
        testCompile "xmlunit:xmlunit:1.6"
        testCompile "org.hamcrest:hamcrest-all:1.3"
    }

    task sourceJar(type: Jar) {
        description = 'A jar that contains source code'
        classifier = 'sources'
        from project.sourceSets.main.java
    }

    artifacts {
        archives sourceJar
    }

    uploadArchives {
        // if you want to enable uploading to some maven repo, add those properties to ~/.gradle/gradle.properties, e.g.:
        /*
        mavenRepoUserName=maven_username
        mavenRepoPassword=super_secret
        mavenRepoReleasesUrl=https://nexus3.example.org/repository/maven-releases/
        mavenRepoSnapshotsUrl=https://nexus3.example.org/repository/maven-snapshots/
         */
        def user = project.hasProperty('mavenRepoUserName') ? mavenRepoUserName : ''
        def password = project.hasProperty('mavenRepoPassword') ? mavenRepoPassword : ''
        def rurl = project.hasProperty('mavenRepoReleasesUrl') ? mavenRepoReleasesUrl : ''
        def surl = project.hasProperty('mavenRepoSnapshotsUrl') ? mavenRepoSnapshotsUrl : ''

        repositories.mavenDeployer {
            repository(url: rurl) {
                authentication(userName: user, password: password)
            }
            snapshotRepository(url: surl) {
                authentication(userName: user, password: password)
            }

        }
    }

}

project("grobid-core") {

    dependencies {
        // local libs
        compile "org.chasen:crfpp:1.0.2"
        compile "fr.limsi.wapiti:wapiti:1.5.0"
        compile "org.wipo.analysers:wipo-analysers:0.0.2"
        compile "eugfc:imageio-pnm:1.0"
        // end of local libs

        compile(group: 'xml-apis', name: 'xml-apis', version: '1.4.01') {
            // otherwise xml-apis 2.0.1 will come from XOM and will result in
            // java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
            //TODO: sort out this problem better
            force = true
        }

        compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.20'
        compile "com.cybozu.labs:langdetect:1.1-20120112"
        compile "com.rockymadden.stringmetric:stringmetric-core_2.10:0.27.3"
        compile "commons-pool:commons-pool:1.6"
        compile "commons-io:commons-io:2.5"
        compile "org.apache.commons:commons-lang3:3.6"
        compile "org.apache.commons:commons-collections4:4.1"
        compile "commons-dbutils:commons-dbutils:1.7"
        compile "org.apache.httpcomponents:httpclient:4.5.3"
        compile "xerces:xercesImpl:2.11.0"
        compile "com.google.guava:guava:19.0"
        compile "net.arnx:jsonic:1.3.10"
        compile "org.apache.pdfbox:pdfbox:1.8.9"
        compile "net.sourceforge.saxon:saxon:9.1.0.8"
        compile "xom:xom:1.2.5"
        compile "com.fasterxml.jackson.core:jackson-core:2.9.0"
        compile "com.fasterxml.jackson.core:jackson-databind:2.9.0"
        compile "com.fasterxml.jackson.module:jackson-module-afterburner:2.9.0"
        compile "joda-time:joda-time:2.9.9"
        compile "org.apache.lucene:lucene-analyzers-common:4.5.1"
    }
}

project("grobid-home") {
    task packageGrobidHome(type: Zip) {
        from('.') {
            include("config/*")
            include("language-detection/**")
            include("lib/**")
            include("pdf2xml/**")
            include("models/**")
            include("lexicon/**")
            include("schemas/**")
            exclude("models/**/*.old")
        }
        into("grobid-home")
    }
    artifacts {
        archives packageGrobidHome
    }
}

project("grobid-service") {
    apply plugin: 'application'

    mainClassName = 'org.grobid.service.main.GrobidServiceApplication'
    tasks.run.workingDir = rootProject.rootDir

    dependencies {
        compile(project(':grobid-core'))
        compile "io.dropwizard:dropwizard-core:1.0.2"
        compile "io.dropwizard:dropwizard-assets:1.0.2"
        compile "com.hubspot.dropwizard:dropwizard-guicier:1.0.0.6"
        compile "io.dropwizard:dropwizard-testing:1.0.2"
        compile "io.dropwizard:dropwizard-forms:1.0.2"
        compile "io.dropwizard:dropwizard-client:1.0.2"
        compile "io.dropwizard:dropwizard-auth:1.0.2"
        compile "org.apache.pdfbox:pdfbox:1.8.9"

        testCompile "io.dropwizard:dropwizard-testing:1.0.2"
    }
}

project("grobid-trainer") {
    dependencies {
        compile(project(':grobid-core'))
        compile "com.rockymadden.stringmetric:stringmetric-core_2.10:0.27.3"
    }
}

coveralls {
    sourceDirs = subprojects.sourceSets.main.allSource.srcDirs.flatten()
}

//Coveralls using Jacoco
/*
def publishedProjects = subprojects

task jacocoMerge(type: JacocoMerge) {
    subprojects.each { subproject ->
        println subproject
        executionData subproject.tasks.withType(Test)
    }
    doFirst {
        executionData = files(executionData.findAll { it.exists() })
    }
}

task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
    description = 'Generates an aggregate report from all subprojects'
    dependsOn publishedProjects.test, jacocoMerge

    additionalSourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs)
    sourceDirectories = files(publishedProjects.sourceSets.main.allSource.srcDirs)
    classDirectories = files(publishedProjects.sourceSets.main.output)
    executionData jacocoMerge.destinationFile

    reports {
        html.enabled = true     // human readable
        xml.enabled = true      // required by coveralls
    }
}

coveralls {
    sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
    jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}

tasks.coveralls {
    group = 'Coverage reports'
    description = 'Uploads the aggregated coverage report to Coveralls'

    dependsOn jacocoRootReport
    onlyIf { System.env.'CI' && !JavaVersion.current().isJava9Compatible() }
}*/
back to top