diff --git a/.azure-pipelines/daily-ci-build.yml b/.azure-pipelines/daily-ci-build.yml index 71bcbb53b04..e3d69ba832f 100644 --- a/.azure-pipelines/daily-ci-build.yml +++ b/.azure-pipelines/daily-ci-build.yml @@ -21,6 +21,7 @@ extends: parameters: pool: name: Azure-Pipelines-1ESPT-ExDShared + image: ubuntu-latest os: linux sdl: sourceAnalysisPool: @@ -42,17 +43,21 @@ extends: - checkout: self submodules: recursive - - task: JavaToolInstaller@0 - displayName: Set up Java + - script: | + sed -i "/mavenCentral()/d" build.gradle + sed -i "/gradlePluginPortal()/d" settings.gradle + sed -i "/mavenCentral()/d" settings.gradle + displayName: Strip plugins and public repos for network-isolated build + + - task: Gradle@4 + displayName: Build and Test SDK inputs: - versionSpec: '17' + gradleWrapperFile: 'gradlew' + workingDirectory: '$(Build.SourcesDirectory)' + tasks: 'assemble test' + options: '--no-daemon -PGraphDeveloperExperiencesPublicPassword=$(ARTIFACTS_PAT)' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.17' jdkArchitectureOption: 'x64' - jdkSourceOption: 'PreInstalled' - - - script: chmod +x gradlew && ./gradlew assemble - displayName: Build SDK - workingDirectory: $(Build.SourcesDirectory) - - - script: ./gradlew test - displayName: Run unit tests - workingDirectory: $(Build.SourcesDirectory) diff --git a/build.gradle b/build.gradle index 69fe2303dc9..08453ac2b98 100644 --- a/build.gradle +++ b/build.gradle @@ -33,6 +33,14 @@ sourceSets { repositories { // You can declare any Maven/Ivy/file repository here. mavenCentral() + maven { + url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1' + name 'GraphDeveloperExperiencesPublic' + credentials(PasswordCredentials) + authentication { + basic(BasicAuthentication) + } + } } apply from: "gradle/dependencies.gradle" @@ -85,6 +93,14 @@ publishing { name = "ADO" url = layout.buildDirectory.dir("publishing-repository") } + maven { + url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1' + name 'GraphDeveloperExperiencesPublic' + credentials(PasswordCredentials) + authentication { + basic(BasicAuthentication) + } + } } } diff --git a/gradle.properties b/gradle.properties index 3aa314c33b4..7eb48290c61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -39,3 +39,7 @@ mavenArtifactSuffix = #enable mavenCentralPublishingEnabled to publish to maven central mavenCentralSnapshotArtifactSuffix = -SNAPSHOT mavenCentralPublishingEnabled=true + +# Azure Artifacts CFS feed credentials +GraphDeveloperExperiencesPublicUsername=microsoftgraph +GraphDeveloperExperiencesPublicPassword=PERSONAL_ACCESS_TOKEN diff --git a/settings.gradle b/settings.gradle index 80f938c581f..64054d030a0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,18 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + maven { + url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1' + name 'GraphDeveloperExperiencesPublic' + credentials(PasswordCredentials) + authentication { + basic(BasicAuthentication) + } + } + } +} + /* * This file was generated by the Gradle 'init' task. *