Skip to content

Commit 60dcbc4

Browse files
authored
Merge pull request #78 from microsoftgraph/feature/v3
- aligns beta sdk with v3 work
2 parents 871dd42 + 986f884 commit 60dcbc4

File tree

31,861 files changed

+1286793
-2120219
lines changed

Some content is hidden

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

31,861 files changed

+1286793
-2120219
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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
with:
1616
java-version: 15
1717
- name: Add execution right to the script
18-
run: chmod +x gradlew
19-
working-directory: ./typesummary
18+
run: |
19+
chmod +x ./typesummary/gradlew
20+
chmod +x ./gradlew
21+
- name: Build SDK
22+
run: ./gradlew --no-daemon build
2023
- name: Build and run type summary project
2124
run: ./gradlew --no-daemon run --args='-o ${{ github.workspace }}/typeSummary.txt'
2225
working-directory: ./typesummary

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919
2020
dependencies {
2121
// Include the sdk as a dependency
22-
implementation 'com.microsoft.graph:microsoft-graph-beta:0.6.0-SNAPSHOT'
22+
implementation 'com.microsoft.graph:microsoft-graph-beta:0.7.0-SNAPSHOT'
2323
}
2424
```
2525

@@ -31,7 +31,7 @@ Add the dependency in `dependencies` in pom.xml
3131
<dependency>
3232
<groupId>com.microsoft.graph</groupId>
3333
<artifactId>microsoft-graph-beta</artifactId>
34-
<version>0.6.0-SNAPSHOT</version>
34+
<version>0.7.0-SNAPSHOT</version>
3535
</dependency>
3636
```
3737

@@ -61,14 +61,14 @@ Register your application by following the steps at [Register your app with the
6161

6262
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.
6363

64-
For an example of authentication in a Java desktop client application, see the [Preview msgraph-sdk-java-auth](https://github.com/microsoftgraph/msgraph-sdk-android-msa-auth-for-android-adapter) and for an Android application see [Preview msgraph-sdk-android-auth](https://github.com/microsoftgraph/msgraph-sdk-android-auth).
64+
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).
6565

6666
### 2.3 Get a GraphServiceClient object
6767

6868
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.
6969

7070
```java
71-
IGraphServiceClient graphClient =
71+
GraphServiceClient graphClient =
7272
GraphServiceClient
7373
.builder()
7474
.authenticationProvider(authenticationProvider)
@@ -83,23 +83,28 @@ After you have a GraphServiceClient that is authenticated, you can begin making
8383

8484
To retrieve the user's drive:
8585

86+
```java
87+
final Drive result = graphClient
88+
.me()
89+
.drive()
90+
.buildRequest()
91+
.get();
92+
System.out.println("Found Drive " + result.id);
93+
```
94+
95+
Or with the asynchronous API.
96+
8697
```java
8798
graphClient
8899
.me()
89100
.drive()
90101
.buildRequest()
91-
.get(new ICallback<Drive>() {
92-
@Override
93-
public void success(final Drive result) {
94-
System.out.println("Found Drive " + result.id);
95-
}
96-
...
97-
// Handle failure case
102+
.futureGet()
103+
.thenApply(result -> {
104+
System.out.println("Found Drive " + result.id);
98105
});
99106
```
100107

101-
For a general overview of how the SDK is designed, see [overview](https://github.com/microsoftgraph/msgraph-sdk-java/wiki/Overview).
102-
103108
## 4. Documentation
104109

105110
For more detailed documentation, see:
@@ -120,7 +125,9 @@ The Microsoft Graph SDK is open for contribution. To contribute to this project,
120125

121126
## 7. Supported Java versions
122127

123-
The Microsoft Graph beta SDK for Java library is supported at runtime for Java 8+ and [Android API revision 15](http://source.android.com/source/build-numbers.html) and greater through [desugaring](https://developer.android.com/studio/write/java8-support.html#library-desugaring).
128+
The Microsoft Graph beta 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.
129+
130+
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.
124131

125132
## 8. License
126133

@@ -129,7 +136,3 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the [MI
129136
## 9. Third-party notices
130137

131138
[Third-party notices](THIRD%20PARTY%20NOTICES)
132-
133-
134-
135-

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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
disable "PropertyPrefixes" // getting false positives because of odata actions & functions (getOrder setOrder)
58+
}
59+
sourceSets {
60+
main {
61+
java.srcDirs = ['../src/main/java']
62+
res.srcDirs = ['../src/main/java']
63+
manifest.srcFile 'AndroidManifest.xml'
64+
}
65+
androidTest {
66+
setRoot '../src/test'
67+
}
68+
}
69+
}
70+
71+
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)