diff --git a/.ado/android-pr.yml b/.ado/android-pr.yml index a37ceab93b83..2e8b76ed8e25 100644 --- a/.ado/android-pr.yml +++ b/.ado/android-pr.yml @@ -24,6 +24,11 @@ jobs: - task: UseNode@1 inputs: version: '10.x' + + # Install NuGet v4.6.4+ + - task: NuGetToolInstaller@1 + inputs: + versionSpec: '>=4.6.4' - task: CmdLine@2 displayName: npm install @@ -112,6 +117,7 @@ jobs: command: pack packagesToPack: 'ReactAndroid/ReactAndroid.nuspec' packDestination: '$(System.DefaultWorkingDirectory)' + buildProperties: buildNumber=$(buildNumber);commitId=$(Build.SourceVersion) - task: Gradle@1 displayName: gradlew clean diff --git a/.ado/publish.yml b/.ado/publish.yml index 6311d057a8dd..a2617ae80b0b 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -28,6 +28,11 @@ jobs: submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch + # Install NuGet v4.6.4+ + - task: NuGetToolInstaller@1 + inputs: + versionSpec: '>=4.6.4' + - task: CmdLine@2 displayName: npm install inputs: @@ -110,6 +115,7 @@ jobs: command: pack packagesToPack: 'ReactAndroid/ReactAndroid.nuspec' packDestination: '$(Build.StagingDirectory)\final' + buildProperties: buildNumber=$(buildNumber);commitId=$(Build.SourceVersion) - task: CmdLine@2 displayName: Do Publish diff --git a/.ado/templates/prep-android-nuget.yml b/.ado/templates/prep-android-nuget.yml index b54fe5c2b4ed..c890912c4b7b 100644 --- a/.ado/templates/prep-android-nuget.yml +++ b/.ado/templates/prep-android-nuget.yml @@ -1,12 +1,12 @@ steps: - task: PowerShell@2 - displayName: Extract version from package.json, and put it in nuspec + displayName: Extract version from package.json, and put it in `buildNumber` variable inputs: targetType: inline # filePath | inline script: | $lines = Get-Content package.json | Where {$_ -match '^\s*"version":.*'} $npmVersion = $lines.Trim().Split()[1].Trim('",'); - (Get-Content ReactAndroid/ReactAndroid.nuspec).replace('__BuildBuildNumber__', $npmVersion) | Set-Content ReactAndroid/ReactAndroid.nuspec + echo "##vso[task.setvariable variable=buildNumber]$npmVersion" # Pretty yucky - but we dont want devmain to have to update versions _all_ over the place - task: PowerShell@2 diff --git a/ReactAndroid/ReactAndroid.nuspec b/ReactAndroid/ReactAndroid.nuspec index 90fe2f6a38f9..5ed23fba7c3e 100644 --- a/ReactAndroid/ReactAndroid.nuspec +++ b/ReactAndroid/ReactAndroid.nuspec @@ -2,10 +2,11 @@ OfficeReact.Android - __BuildBuildNumber__ + $buildNumber$ Contains Android Implementation of React-Native Microsoft https://github.com/microsoft/react-native + false