Skip to content

Commit 5b92eb3

Browse files
authored
Merge pull request #43 from microsoftgraph/feature/v1-refresh
- updates with latest non-gen changes from v1
2 parents 446239b + d612a77 commit 5b92eb3

34 files changed

+361355
-117
lines changed

.azure-pipelines/generate-beta-models.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ steps:
107107
workingDirectory: '$(Build.SourcesDirectory)' # Set the root for a multi-repo pipeline. /s
108108
enabled: true
109109

110+
- task: PowerShell@2
111+
displayName: 'Increment minor version number'
112+
inputs:
113+
targetType: filePath
114+
filePath: '$(Build.SourcesDirectory)/msgraph-beta-sdk-java/Scripts/incrementMinorVersion.ps1'
115+
workingDirectory: '$(Build.SourcesDirectory)/msgraph-beta-sdk-java/Scripts'
116+
enabled: true
117+
110118
- task: PowerShell@2
111119
displayName: 'Copy generated requests and models into the repo'
112120
inputs:

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.java]
2+
indent_style = space
3+
indent_size = 4
4+
insert_final_newline = true
5+
trim_trailing_whitespace = true

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @baywet @ddyett @MichaelMainer @nikithauc @zengin

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ Fixes #
1616

1717
<!-- Optional. Provide related links. This might be other pull requests, code files, StackOverflow posts. Delete this section if it is not used. -->
1818
### Other links
19+
20+
<!-- Is this PR adding a new hand crafted extension class? If so, please update $filesThatShouldNotBeDeleted variable in .azure-pipelines/generate-beta-models.yml file, so that it doesn't get deleted by auto generation pipeline.-->
1921
-

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/create-beta-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
MESSAGE_TITLE: Generated beta models and request builders using Typewriter
40-
MESSAGE_BODY: "This pull request was automatically created by the GitHub Action, **${{github.workflow}}**. \n\n The commit hash is _${{github.sha}}_. \n\n **Important** Check for unexpected deletions or changes in this PR. \n\n - [ ] update version in gradle.properties and Constants.java. \n\n cc: @darrelmiller"
40+
MESSAGE_BODY: "This pull request was automatically created by the GitHub Action, **${{github.workflow}}**. \n\n The commit hash is _${{github.sha}}_. \n\n **Important** Check for unexpected deletions or changes in this PR. \n\n cc: @darrelmiller"
4141
REVIEWERS: peombwa,ddyett,zengin,nikithauc,baywet
4242
ASSIGNEDTO: baywet
4343
LABELS: generated

.github/workflows/type-summary.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "update type summary"
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.java'
7+
- '**/*.yml'
8+
9+
jobs:
10+
update-type-summary:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-java@v1
15+
with:
16+
java-version: 15
17+
- name: Add execution right to the script
18+
run: chmod +x gradlew
19+
working-directory: ./typesummary
20+
- name: Build and run type summary project
21+
run: ./gradlew --no-daemon run --args='-o ${{ github.workspace }}/typeSummary.txt'
22+
working-directory: ./typesummary
23+
- name: Get branch name
24+
run: |
25+
$branchName = $Env:GITHUB_REF.replace("refs/heads/", "")
26+
echo "CURRENT_BRANCH=${branchName}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
27+
shell: pwsh
28+
- name: push
29+
uses: github-actions-x/[email protected]
30+
with:
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
push-branch: ${{ env.CURRENT_BRANCH }}
33+
commit-message: '- updates types summary'
34+
force-add: 'true'
35+
files: typeSummary.txt
36+
name: Microsoft Graph DevX Tooling
37+

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ hs_err_pid*
3131

3232
# Maven
3333
/target/
34-
/pom.xml
3534
local.properties
3635
.idea

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
[![Download](https://api.bintray.com/packages/microsoftgraph/Maven/microsoft-graph-beta/images/download.svg) ](https://bintray.com/microsoftgraph/Maven/microsoft-graph/_latestVersion)
44

5-
6-
Get started with the Microsoft Graph SDK for Java by integrating the [Microsoft Graph API](https://graph.microsoft.io/en-us/getting-started) into your Java application!
5+
Get started with the Microsoft Graph SDK for Java by integrating the [Microsoft Graph API](https://developer.microsoft.com/en-us/graph/get-started/java) into your Java application!
76

87
> **Note:** this SDK allows you to build applications using the [beta](https://docs.microsoft.com/en-us/graph/use-the-api#version) of Microsoft Graph. If you want to use the production supported Microsoft Graph APIs under v1.0, use our [v1.0 SDK](https://github.com/microsoftgraph/msgraph-sdk-java) instead.
98

Scripts/incrementMinorVersion.ps1

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.Synopsis
6+
Increment the minor version string in the gradle.properties if the major,
7+
minor, or patch version hasn't been manually updated.
8+
.Description
9+
Assumptions:
10+
Targets Gradle.properties
11+
This script assumes it is run from the repo root.
12+
Minor version is typically auto-incremented.
13+
14+
#>
15+
16+
function Update-ReadmeVersion([string]$readmeFilePath, [version]$version) {
17+
$readmeFileContent = Get-Content -Path $readmeFilePath -Raw
18+
$readmeFileContent = $readmeFileContent -replace "\d{1,}\.\d{1,}\.\d{1,}", $version.ToString()
19+
Set-Content -Path $readmeFilePath $readmeFileContent
20+
}
21+
22+
function Update-TelemetryVersion([string]$telemetryFilePath, [version]$version) {
23+
$telemetryFileContent = Get-Content -Path $telemetryFilePath -Raw
24+
$telemetryFileContent = $telemetryFileContent -replace "\d{1,}\.\d{1,}\.\d{1,}", $version.ToString()
25+
Set-Content -Path $telemetryFilePath $telemetryFileContent
26+
}
27+
28+
function Update-PackageVersion([string]$propertiesFilePath, [version]$version) {
29+
$propertiesFileContent = Get-Content -Path $propertiesFilePath -Raw
30+
$propertiesFileContent = $propertiesFileContent -replace "mavenMajorVersion\s+=\s+\d{1,}", "mavenMajorVersion = $($version.Major)"
31+
$propertiesFileContent = $propertiesFileContent -replace "mavenMinorVersion\s+=\s+\d{1,}", "mavenMinorVersion = $($version.Minor)"
32+
$propertiesFileContent = $propertiesFileContent -replace "mavenPatchVersion\s+=\s+\d{1,}", "mavenPatchVersion = $($version.Build)"
33+
Set-Content -Path $propertiesFilePath $propertiesFileContent
34+
}
35+
function Get-CurrentTelemetryVersion([string]$telemetryFilePath) {
36+
$telemetryFileContent = Get-Content -Path $telemetryFilePath -Raw
37+
if($telemetryFileContent -match "(\d{1,}\.\d{1,}\.\d{1,})") {
38+
return [version]::Parse($Matches[1])
39+
} else {
40+
Write-Error "Invalid version number format"
41+
return $null;
42+
}
43+
}
44+
45+
function Update-MinorVersionNumber([version]$currentVersion) {
46+
return [version]::new($currentVersion.Major, $currentVersion.Minor + 1, 0);
47+
}
48+
49+
function Update-MinorVersion() {
50+
$readmeFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../readme.md"
51+
$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"
53+
$currentVersion = Get-CurrentTelemetryVersion -telemetryFilePath $telemetryFilePath
54+
$nextVersion = Update-MinorVersionNumber -currentVersion $currentVersion
55+
Update-ReadmeVersion -version $nextVersion -readmeFilePath $readmeFilePath
56+
Update-TelemetryVersion -version $nextVersion -telemetryFilePath $telemetryFilePath
57+
Update-PackageVersion -version $nextVersion -propertiesFilePath $propertiesFilePath
58+
}
59+
Update-MinorVersion

0 commit comments

Comments
 (0)