summaryrefslogtreecommitdiff
path: root/src/mongo/embedded/mongo_embedded/java/jar/build.gradle
blob: 566770c793f4c8b963974741f99f6eab369d14ac (plain)
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
apply plugin: 'java-library'
apply plugin: 'osgi'
apply plugin: 'maven-publish'
apply plugin: 'optional-base'
apply plugin: 'com.jfrog.artifactory'

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

jar {
    sourceSets {
        main {
            java.srcDir '../src'
            resources.srcDirs '../jniLibs'
        }
    }

    manifest {
        instruction 'Automatic-Module-Name', 'org.mongodb.driver.embedded.client.capi'
        instruction 'Build-Version', getGitVersion()
        instruction 'Import-Package',
                     'com.mongodb.*'
    }
}

task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    classifier = 'sources'
}

task javadocJar(type: Jar) {
    from javadoc
    classifier = 'javadoc'
}

dependencies {
    api "net.java.dev.jna:jna:$jnaVersion"
    api 'org.slf4j:slf4j-api:1.7.6', optional
}

publishing {
    publications {
        maven(MavenPublication) {
            artifactId = libraryName

            from components.java
            artifact sourcesJar
            artifact javadocJar

            pom {
                name = pomName
                description = pomDescription
                url = pomUrl
                licenses {
                    license {
                        name = pomLicenseName
                        url = pomLicenseUrl
                    }
                }
                scm {
                    connection = "scm:" + pomScmConnection
                    developerConnection = "scm:" + pomScmDevConnection
                    url = pomScmUrl
                }
            }
        }
    }

    repositories {
        maven {
            name = 'local'
            url = "$buildDir/repo"
        }
    }
}


artifactory {
    contextUrl = "http://artifactory.corp.mongodb.com/artifactory"
    publish {
        repository {
            repoKey = 'mongodb-mobile-local'
            username = System.getenv('artifactory_mobile_user')
            password = System.getenv('artifactory_mobile_pass')
            maven = true
        }
        defaults {
            publications ('maven')
        }
    }
    resolve {
        repository {
            repoKey = 'maven'
            username = System.getenv('artifactory_mobile_user')
            password = System.getenv('artifactory_mobile_pass')
            maven = true
        }
    }
}