diff --git a/build.gradle b/build.gradle index 69160639816..63cdb5f82a6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,19 @@ /* - * This build file was generated by the Gradle 'init' task. + * This 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 + * User Manual available at https://docs.gradle.org/6.6/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' -apply plugin: 'signing' +plugins { + // Apply the java-library plugin to add support for Java Library + id 'java-library' + id 'java' + id 'eclipse' + id 'maven-publish' + id 'signing' +} // In this section you declare where to find the dependencies of your project repositories { @@ -23,21 +24,18 @@ repositories { } 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.13' - compile 'com.google.code.gson:gson:2.8.6' + implementation 'com.google.code.gson:gson:2.8.6' - compile 'com.sun.jersey:jersey-server:1.19.4' + implementation 'com.sun.jersey:jersey-server:1.19.4' // Core Http library - compile('com.microsoft.graph:microsoft-graph-core:1.0.1') + implementation 'com.microsoft.graph:microsoft-graph-core:1.0.1' } def pomConfig = { @@ -54,23 +52,33 @@ def pomConfig = { //Maven Central Snapshot: publishSnapshotPublicationToMavenRepository //Maven Central Release: publishMavenCentralReleasePublicationToMaven2Repository //Bintray Snapshot: publishSnapshotPublicationToMaven3Repository -//Bintray Release: uploadArchives -publishing { +task sourceJar(type: Jar) { + from sourceSets.main.allJava + archiveClassifier = 'sources' +} - publications { +task javadocJar(type: Jar, dependsOn: javadoc) { + from javadoc.destinationDir + archiveClassifier = 'javadoc' +} - maven(MavenPublication) { +signing { + sign configurations.archives +} +tasks.withType(Sign)*.enabled = mavenCentralPublishingEnabled.toBoolean() - groupId 'com.microsoft.graph' +publishing { - artifactId 'microsoft-graph-beta' + publications { + maven(MavenPublication) { + groupId project.property('mavenGroupId') + artifactId project.property('mavenArtifactId') version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenArtifactSuffix}" - from components.java - artifact sourceJar + artifact javadocJar pom.withXml { def root = asNode() root.appendNode('name', 'Microsoft Graph Beta SDK for Java') @@ -83,26 +91,22 @@ publishing { } Snapshot(MavenPublication) { customizePom(pom) - groupId 'com.microsoft.graph' - artifactId 'microsoft-graph-beta' + groupId project.property('mavenGroupId') + artifactId project.property('mavenArtifactId') version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenCentralSnapshotArtifactSuffix}" from components.java pom.withXml { def pomFile = file("${project.buildDir}/generated-pom.xml") writeTo(pomFile) } - artifact(sourceJar) { - classifier = 'sources' - } - artifact(javadocJar) { - classifier = 'javadoc' - } + artifact sourceJar + artifact javadocJar } mavenCentralRelease(MavenPublication) { customizePom(pom) - groupId 'com.microsoft.graph' - artifactId 'microsoft-graph-beta' + groupId project.property('mavenGroupId') + artifactId project.property('mavenArtifactId') version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}" from components.java pom.withXml { @@ -114,12 +118,8 @@ publishing { extension = 'pom.asc' } } - artifact(sourceJar) { - classifier = 'sources' - } - artifact(javadocJar) { - classifier = 'javadoc' - } + artifact sourceJar + artifact javadocJar project.tasks.signArchives.signatureFiles.each { artifact(it) { def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/ @@ -136,55 +136,57 @@ publishing { } repositories { maven { - url = project.property('mavenCentralSnapshotUrl') + url = 'https://oss.sonatype.org/content/repositories/snapshots' + name = 'sonatypeSnapshot' credentials { if (project.rootProject.file('local.properties').exists()) { - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - username = properties.getProperty('sonatypeUsername') - password = properties.getProperty('sonatypePassword') - } } } maven { - url = project.property('mavenCentralReleaseUrl') + url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2' + name = 'sonatype' credentials { if (project.rootProject.file('local.properties').exists()) { - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - username = properties.getProperty('sonatypeUsername') - password = properties.getProperty('sonatypePassword') - } } } maven { - url = project.property('mavenBintraySnapshotUrl') + url = 'http://oss.jfrog.org/artifactory/oss-snapshot-local' + name = 'jfrogSnapshot' credentials { if (project.rootProject.file('local.properties').exists()) { - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - username = (properties.containsKey('bintray.user')) ? properties.getProperty('bintray.user').toLowerCase() : "BINTRAY_USERNAME" - password = properties.getProperty('bintray.apikey') + } + } + } + maven { + url = 'https://oss.jfrog.org/artifactory/libs-release' + name = 'jfrog' + + credentials { + if (project.rootProject.file('local.properties').exists()) { + Properties properties = new Properties() + properties.load(project.rootProject.file('local.properties').newDataInputStream()) + username = (properties.containsKey('bintray.user')) ? properties.getProperty('bintray.user').toLowerCase() : "BINTRAY_USERNAME" + password = properties.getProperty('bintray.apikey') } } } @@ -192,11 +194,6 @@ publishing { } -task sourceJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allJava -} - compileJava { sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -210,74 +207,12 @@ def getVersionName() { return "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenArtifactSuffix}" } -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) { - - url = url + "/" + getVersionName() - - 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 jar archives sourceJar archives javadocJar } -signing { - sign configurations.archives -} -tasks.withType(Sign)*.enabled = mavenCentralPublishingEnabled.toBoolean() - def customizePom(pom) { pom.withXml { def root = asNode() @@ -339,7 +274,7 @@ model { tasks.publishMavenCentralReleasePublicationToMavenLocal { dependsOn project.tasks.signArchives } - tasks.publishMavenCentralReleasePublicationToMaven2Repository { + tasks.publishMavenCentralReleasePublicationToSonatypeRepository { dependsOn project.tasks.signArchives } } diff --git a/gradle.properties b/gradle.properties index 89132d5d16c..ccdb06a20f2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,8 +21,6 @@ ## linux requires 10G, OSX requires 11G org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx2g -mavenRepoUrl = https://api.bintray.com/content/microsoftgraph/Maven/microsoft-graph-beta -mavenBintraySnapshotUrl = http://oss.jfrog.org/artifactory/oss-snapshot-local mavenGroupId = com.microsoft.graph mavenArtifactId = microsoft-graph-beta mavenMajorVersion = 0 @@ -40,7 +38,5 @@ Username="USERNAME" Password="PASSWORD" #enable mavenCentralPublishingEnabled to publish to maven central -mavenCentralSnapshotUrl=https://oss.sonatype.org/content/repositories/snapshots -mavenCentralReleaseUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2 mavenCentralSnapshotArtifactSuffix = -SNAPSHOT mavenCentralPublishingEnabled=false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c44b679acd3..e708b1c023e 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6ab317ec32f..6c9a2247756 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Thu Dec 07 16:02:17 AEDT 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip diff --git a/gradlew b/gradlew index 450358c1551..4f906e0c811 100644 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="-Xmx128m -Dfile.encoding=UTF-8" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -66,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -109,10 +126,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -138,19 +156,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -159,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index cdd00dfa2d7..ac1b06f9382 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Xmx128m -Dfile.encoding=UTF-8 +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,28 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle index d00fcd070d3..80f938c581f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,18 +1,10 @@ /* - * This settings file was generated by the Gradle 'init' task. + * This file was generated by the Gradle 'init' task. * * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be empty or even removed. * * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html + * in the user manual at https://docs.gradle.org/6.6/userguide/multi_project_builds.html */ -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - rootProject.name = 'msgraph-beta-sdk-java'