Skip to content

Commit 76e3517

Browse files
authored
Merge pull request #99 from microsoftgraph/dev
master sync and 1.0.6 release
2 parents 9c26edc + cbb9444 commit 76e3517

File tree

15 files changed

+223
-166
lines changed

15 files changed

+223
-166
lines changed

.azure-pipelines/buildAndPackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ steps:
8585
settings.gradle
8686
gradle.properties
8787
**/gradle/wrapper/*
88-
Scripts/getLatestVersion.ps1
88+
Scripts/**
8989
TargetFolder: '$(Build.ArtifactStagingDirectory)/'
9090

9191
- task: PublishBuildArtifacts@1

.azure-pipelines/prValidate.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ steps:
4343
inputs:
4444
debugMode: false
4545

46-
- task: PowerShell@2
47-
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'dev'))
48-
inputs:
49-
filePath: '$(System.DefaultWorkingDirectory)\Scripts\validateMavenVersion.ps1'
50-
pwsh: true
51-
arguments: '-packageName "$(PACKAGE_NAME)" -propertiesPath "$(PROPERTIES_PATH)"'
52-
5346
- task: Gradle@2
5447
inputs:
5548
gradleWrapperFile: 'gradlew'

.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/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
- package-ecosystem: maven
8+
- package-ecosystem: github-actions
99
directory: "/"
1010
schedule:
1111
interval: daily

.gitignore

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

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

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/httpcore/TelemetryHandler.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

Scripts/validateMavenVersion.ps1

Lines changed: 0 additions & 67 deletions
This file was deleted.

build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ java {
2020
modularity.inferModulePath = true
2121
}
2222

23+
sourceSets {
24+
main {
25+
java {
26+
exclude 'pom.xml'
27+
}
28+
}
29+
}
30+
2331
// In this section you declare where to find the dependencies of your project
2432
repositories {
2533
// Use jcenter for resolving your dependencies.
@@ -30,7 +38,7 @@ repositories {
3038

3139
dependencies {
3240
// Use JUnit test framework
33-
testImplementation 'junit:junit:4.13'
41+
testImplementation 'junit:junit:4.13.1'
3442

3543
api 'com.squareup.okhttp3:okhttp:3.12.1'
3644

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mavenGroupId = com.microsoft.graph
2525
mavenArtifactId = microsoft-graph-core
2626
mavenMajorVersion = 1
2727
mavenMinorVersion = 0
28-
mavenPatchVersion = 5
28+
mavenPatchVersion = 6
2929
mavenArtifactSuffix =
3030
nightliesUrl = http://dl.bintray.com/MicrosoftGraph/Maven
3131

0 commit comments

Comments
 (0)