Skip to content

Commit 8a3ba50

Browse files
authored
Merge pull request #522 from microsoftgraph/feature/v3
release v3
2 parents 428a13a + 54f368f commit 8a3ba50

File tree

14,317 files changed

+574319
-944583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

14,317 files changed

+574319
-944583
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Checks the SDK only using APIs from the targeted API level"
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
pull_request:
8+
branches:
9+
- dev
10+
- feature/v3
11+
12+
jobs:
13+
lint-api-level:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: 15
20+
- name: Setup Android SDK
21+
uses: android-actions/setup-android@v2
22+
- name: Add execution right to the script
23+
run: chmod +x gradlew
24+
working-directory: ./android
25+
- name: Build SDK with Android project configuration
26+
id: lint
27+
run: ./gradlew --no-daemon build
28+
working-directory: ./android
29+
- name: Upload linting results
30+
if: failure() && steps.lint.outcome == 'failure'
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: lint-report
34+
path: ./android/build/reports

.github/workflows/type-summary.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
- name: Add execution right to the script
1818
run: chmod +x gradlew
1919
working-directory: ./typesummary
20+
- name: Build SDK
21+
run: ./gradlew --no-daemon build
2022
- name: Build and run type summary project
2123
run: ./gradlew --no-daemon run --args='-o ${{ github.workspace }}/typeSummary.txt'
2224
working-directory: ./typesummary

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ repositories {
1919
2020
dependencies {
2121
// Include the sdk as a dependency
22-
implementation 'com.microsoft.graph:microsoft-graph:2.10.0'
22+
implementation 'com.microsoft.graph:microsoft-graph:3.0.0'
23+
// Uncomment the line below if you are building an android application
24+
//implementation 'com.google.guava:guava:29.0-android'
2325
}
2426
```
2527

@@ -31,7 +33,7 @@ Add the dependency in `dependencies` in pom.xml
3133
<dependency>
3234
<groupId>com.microsoft.graph</groupId>
3335
<artifactId>microsoft-graph</artifactId>
34-
<version>2.10.0</version>
36+
<version>3.0.0</version>
3537
</dependency>
3638
```
3739

@@ -49,14 +51,14 @@ Register your application by following the steps at [Register your app with the
4951

5052
An instance of the **GraphServiceClient** class handles building requests, sending them to the Microsoft Graph API, and processing the responses. To create a new instance of this class, you need to provide an instance of `IAuthenticationProvider`, which can authenticate requests to Microsoft Graph.
5153

52-
For an example of authentication in a Java desktop client or server application, see the [Preview msgraph-sdk-java-auth](https://github.com/microsoftgraph/msgraph-sdk-java-auth) and for an Android application see [Preview msgraph-sdk-android-auth](https://github.com/microsoftgraph/msgraph-sdk-android-auth).
54+
For an example of how to get an authentication provider, see [choose a Microsoft Graph authentication provider](https://docs.microsoft.com/graph/sdks/choose-authentication-providers?tabs=Java).
5355

5456
### 2.3 Get a GraphServiceClient object
5557

5658
After you have set the correct application ID and URL, you must get a **GraphServiceClient** object to make requests against the service. The SDK stores the account information for you, but when a user signs in for the first time, it invokes the UI to get the user's account information.
5759

5860
```java
59-
IGraphServiceClient graphClient =
61+
GraphServiceClient graphClient =
6062
GraphServiceClient
6163
.builder()
6264
.authenticationProvider(authenticationProvider)
@@ -71,18 +73,25 @@ After you have a GraphServiceClient that is authenticated, you can begin making
7173

7274
To retrieve the user's drive:
7375

76+
```java
77+
final Drive result = graphClient
78+
.me()
79+
.drive()
80+
.buildRequest()
81+
.get();
82+
System.out.println("Found Drive " + result.id);
83+
```
84+
85+
Or with the asynchronous API.
86+
7487
```java
7588
graphClient
7689
.me()
7790
.drive()
7891
.buildRequest()
79-
.get(new ICallback<Drive>() {
80-
@Override
81-
public void success(final Drive result) {
82-
System.out.println("Found Drive " + result.id);
83-
}
84-
...
85-
// Handle failure case
92+
.futureGet()
93+
.thenApply(result -> {
94+
System.out.println("Found Drive " + result.id);
8695
});
8796
```
8897

@@ -106,7 +115,9 @@ The Microsoft Graph SDK is open for contribution. To contribute to this project,
106115

107116
## 7. Supported Java versions
108117

109-
The Microsoft Graph SDK for Java library is supported at runtime for Java 7+ and [Android API revision 15](http://source.android.com/source/build-numbers.html) and greater.
118+
The Microsoft Graph SDK for Java library is supported at runtime for Java 8+ and [Android API revision 26](http://source.android.com/source/build-numbers.html) and greater.
119+
120+
Android developers targeting lower android API levels can do so by [enabling desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) in their project.
110121

111122
## 8. License
112123

@@ -115,11 +126,3 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the [MI
115126
## 9. Third-party notices
116127

117128
[Third-party notices](THIRD%20PARTY%20NOTICES)
118-
119-
120-
121-
122-
123-
124-
125-

Scripts/incrementMinorVersion.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Update-MinorVersionNumber([version]$currentVersion) {
4949
function Update-MinorVersion() {
5050
$readmeFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../README.md"
5151
$propertiesFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../gradle.properties"
52-
$telemetryFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../src/main/java/com/microsoft/graph/core/Constants.java"
52+
$telemetryFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../src/main/java/com/microsoft/graph/info/Constants.java"
5353
$currentVersion = Get-CurrentTelemetryVersion -telemetryFilePath $telemetryFilePath
5454
$nextVersion = Update-MinorVersionNumber -currentVersion $currentVersion
5555
Update-ReadmeVersion -version $nextVersion -readmeFilePath $readmeFilePath

android/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.gradle
2+
build

android/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.microsoft.graph"
5+
android:installLocation="auto"
6+
tools:ignore="UnusedAttribute">
7+
8+
<uses-permission android:name="android.permission.INTERNET" />
9+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
10+
11+
<supports-screens
12+
android:anyDensity="true"
13+
android:largeScreens="true"
14+
android:normalScreens="true"
15+
android:smallScreens="true"
16+
android:xlargeScreens="true" />
17+
18+
<application
19+
android:hardwareAccelerated="true"
20+
android:fullBackupContent="true"
21+
android:allowBackup="true"
22+
android:supportsRtl="true"
23+
tools:ignore="GoogleAppIndexingWarning"></application>
24+
</manifest>

android/build.gradle

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
gradlePluginPortal()
5+
maven {
6+
url "https://plugins.gradle.org/m2/"
7+
}
8+
}
9+
10+
dependencies {
11+
classpath "com.gradle:gradle-enterprise-gradle-plugin:3.5"
12+
classpath "com.android.tools.build:gradle:4.0.1"
13+
classpath "com.github.ben-manes:gradle-versions-plugin:0.36.0"
14+
}
15+
}
16+
17+
repositories {
18+
google()
19+
gradlePluginPortal()
20+
}
21+
22+
apply plugin: "com.android.library"
23+
apply plugin: "com.github.ben-manes.versions"
24+
25+
android {
26+
compileSdkVersion 30
27+
28+
defaultConfig {
29+
versionCode 1
30+
versionName "1.0"
31+
minSdkVersion 26
32+
targetSdkVersion 30
33+
}
34+
35+
buildTypes {
36+
release {
37+
minifyEnabled false
38+
}
39+
}
40+
41+
compileOptions {
42+
sourceCompatibility JavaVersion.VERSION_1_8
43+
targetCompatibility JavaVersion.VERSION_1_8
44+
}
45+
46+
lintOptions {
47+
textOutput "stdout"
48+
checkAllWarnings true
49+
warningsAsErrors true
50+
disable "UnusedResources" // Unused will be removed on release
51+
disable "IconExpectedSize" // Using the material icons provided from Google
52+
disable "GoogleAppIndexingApiWarning" // We might want to index our app later
53+
disable "InvalidPackage" // Butterknife, Okio and Realm
54+
disable "ResourceType" // Annotation binding
55+
disable "GradleDependency"
56+
disable "NewerVersionAvailable"
57+
}
58+
sourceSets {
59+
main {
60+
java.srcDirs = ['../src/main/java']
61+
res.srcDirs = ['../src/main/java']
62+
manifest.srcFile 'AndroidManifest.xml'
63+
}
64+
androidTest {
65+
setRoot '../src/test'
66+
}
67+
}
68+
}
69+
70+
apply from: "../gradle/dependencies.gradle"

android/gradle.properties

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE users:
4+
# Settings specified in this file will override any Gradle settings
5+
# configured through the IDE.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true
19+
20+
# The size of the library demands a large amount of RAM to build. Increase as necessary if you get GC errors
21+
## linux requires 10G, OSX requires 11G
22+
org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx2g
23+
org.gradle.parallel=true
24+
org.gradle.caching=true
25+
26+
mavenGroupId = com.microsoft.graph
27+
mavenArtifactId = microsoft-graph
28+
mavenMajorVersion = 2
29+
mavenMinorVersion = 3
30+
mavenPatchVersion = 1
31+
mavenArtifactSuffix =
32+
33+
#These values are used to run functional tests
34+
#If you wish to run the functional tests, edit the gradle.properties
35+
#file in your user directory instead of adding them here.
36+
#ex: C:\Users\username\.gradle\gradle.properties
37+
ClientId="CLIENT_ID"
38+
Username="USERNAME"
39+
Password="PASSWORD"
40+
41+
#enable mavenCentralPublishingEnabled to publish to maven central
42+
mavenCentralSnapshotArtifactSuffix = -SNAPSHOT
43+
mavenCentralPublishingEnabled=false
57.8 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)