This repository was archived by the owner on Jan 6, 2026. It is now read-only.
forked from microsoftgraph/msgraph-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
152 lines (102 loc) · 3.6 KB
/
build.gradle
File metadata and controls
152 lines (102 loc) · 3.6 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* user guide available at https://docs.gradle.org/4.5/userguide/java_library_plugin.html
*/
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'maven-publish'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:20.0'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.sun.jersey:jersey-server:1.19.4'
}
def pomConfig = {
licenses {
license([:]) {
name "MIT License"
url "http://opensource.org/licenses/MIT"
distribution "repo"
}
}
}
publishing {
publications {
maven(MavenPublication) {
groupId 'com.microsoft.graph'
artifactId 'microsoft-graph'
version '${mavenMajorVersion}.${mavenMinorVersion}-SNAPSHOT'
from components.java
artifact sourceJar
pom.withXml {
def root = asNode()
root.appendNode('name', 'Preview Microsoft Graph SDK for Java')
root.appendNode('url', 'https://github.com/microsoftgraph/msgraph-sdk-java')
root.children().last() + pomConfig
}
}
}
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
def getVersionCode() {
return mavenMajorVersion.toInteger() * 10000 + mavenMinorVersion.toInteger() * 100 + mavenPatchVersion.toInteger()
}
def getVersionName() {
return "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}"
}
uploadArchives {
def bintrayUsername = ""
def bintrayApikey = ""
if (project.rootProject.file('local.properties').exists()) {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintrayUsername = properties.getProperty('bintray.user')
bintrayApikey = properties.getProperty('bintray.apikey')
}
configuration = configurations.archives
repositories.mavenDeployer {
pom {
setGroupId project.mavenGroupId
setArtifactId project.mavenArtifactId
setVersion getVersionName()
}
repository (url: project.mavenRepoUrl) {
authentication(
// put these values in local file ~/.gradle/gradle.properties
userName: project.hasProperty("bintrayUsername") ? project.bintrayUsername : bintrayUsername,
password: project.hasProperty("bintrayApikey") ? project.bintrayApikey : bintrayApikey
)
}
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives javadocJar
}