From e98771ff3924e59a406db3fe73516fa643db50b6 Mon Sep 17 00:00:00 2001 From: Brett Lim Date: Fri, 20 Mar 2020 17:53:22 +1100 Subject: [PATCH 1/4] Removed a redundant block --- .../example/lib/presentation/pages/calendar_add.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/device_calendar/example/lib/presentation/pages/calendar_add.dart b/device_calendar/example/lib/presentation/pages/calendar_add.dart index 16dc2e7c..96deb056 100644 --- a/device_calendar/example/lib/presentation/pages/calendar_add.dart +++ b/device_calendar/example/lib/presentation/pages/calendar_add.dart @@ -65,7 +65,7 @@ class _CalendarAddPageState extends State { ), ], ), - if (Platform.isAndroid) ...[ + if (Platform.isAndroid) TextFormField( decoration: const InputDecoration( labelText: 'Local Account Name', @@ -73,7 +73,6 @@ class _CalendarAddPageState extends State { ), onSaved: (String value) => _localAccountName = value, ), - ] ], ), ), From abffa2e3c48db51377b6504a50325bde4eb7b0e5 Mon Sep 17 00:00:00 2001 From: Brett Lim Date: Tue, 24 Mar 2020 14:21:31 +1100 Subject: [PATCH 2/4] Add credentials for publishing --- azure-pipelines.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b14385ee..7d4a803f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,6 +94,28 @@ stages: Write-Host " (i) Updated CHANGELOG.md content: $newChangelogContent" $newChangelogContent | Set-Content -Path "$(Build.SourcesDirectory)/device_calendar/CHANGELOG.md" + + - task: PowerShell@2 + displayName: 'Create publisher credentials file' + inputs: + targetType: 'inline' + script: | + cd $(FlutterToolPath) + cd.. + cd .pub-cache/ + + $credentials = @{ + accessToken = "$env:MAPPED_ACCESS_TOKEN" + refreshToken = "$env:MAPPED_REFRESH_TOKEN" + tokenEndpoint = "$env:MAPPED_TOKEN_ENDPOINT" + scopes = @("https://www.googleapis.com/auth/userinfo.email","openid") + expiration = "$env:MAPPED_EXPIRATION" + } | ConvertTo-Json | Out-File "credentials.json" + env: + MAPPED_ACCESS_TOKEN: $(ACCESS_TOKEN) + MAPPED_REFRESH_TOKEN: $(REFRESH_TOKEN) + MAPPED_TOKEN_ENDPOINT: $(TOKEN_ENDPOINT) + MAPPED_EXPIRATION: $(EXPIRATION) - task: CmdLine@2 displayName: 'Dry run publish' @@ -140,6 +162,28 @@ stages: Write-Host "##vso[task.setvariable variable=versionSummary]$summary" + - task: PowerShell@2 + displayName: 'Create publisher credentials file' + inputs: + targetType: 'inline' + script: | + cd $(FlutterToolPath) + cd.. + cd .pub-cache/ + + $credentials = @{ + accessToken = "$env:MAPPED_ACCESS_TOKEN" + refreshToken = "$env:MAPPED_REFRESH_TOKEN" + tokenEndpoint = "$env:MAPPED_TOKEN_ENDPOINT" + scopes = @("https://www.googleapis.com/auth/userinfo.email","openid") + expiration = "$env:MAPPED_EXPIRATION" + } | ConvertTo-Json | Out-File "credentials.json" + env: + MAPPED_ACCESS_TOKEN: $(ACCESS_TOKEN) + MAPPED_REFRESH_TOKEN: $(REFRESH_TOKEN) + MAPPED_TOKEN_ENDPOINT: $(TOKEN_ENDPOINT) + MAPPED_EXPIRATION: $(EXPIRATION) + - task: CmdLine@2 displayName: 'Dry run publish' inputs: From 3132d1f942a30a3a4e6907d3c2ed95208719049c Mon Sep 17 00:00:00 2001 From: Brett Lim Date: Tue, 24 Mar 2020 14:23:16 +1100 Subject: [PATCH 3/4] Expiration is an integer --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7d4a803f..a86b881b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -109,7 +109,7 @@ stages: refreshToken = "$env:MAPPED_REFRESH_TOKEN" tokenEndpoint = "$env:MAPPED_TOKEN_ENDPOINT" scopes = @("https://www.googleapis.com/auth/userinfo.email","openid") - expiration = "$env:MAPPED_EXPIRATION" + expiration = $env:MAPPED_EXPIRATION } | ConvertTo-Json | Out-File "credentials.json" env: MAPPED_ACCESS_TOKEN: $(ACCESS_TOKEN) @@ -176,7 +176,7 @@ stages: refreshToken = "$env:MAPPED_REFRESH_TOKEN" tokenEndpoint = "$env:MAPPED_TOKEN_ENDPOINT" scopes = @("https://www.googleapis.com/auth/userinfo.email","openid") - expiration = "$env:MAPPED_EXPIRATION" + expiration = $env:MAPPED_EXPIRATION } | ConvertTo-Json | Out-File "credentials.json" env: MAPPED_ACCESS_TOKEN: $(ACCESS_TOKEN) From 1c2a09f1c11fb373213308bfff2efa7385888afe Mon Sep 17 00:00:00 2001 From: Brett Lim Date: Tue, 24 Mar 2020 15:25:45 +1100 Subject: [PATCH 4/4] Update variables --- azure-pipelines.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a86b881b..c57f3cb6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -105,17 +105,12 @@ stages: cd .pub-cache/ $credentials = @{ - accessToken = "$env:MAPPED_ACCESS_TOKEN" - refreshToken = "$env:MAPPED_REFRESH_TOKEN" - tokenEndpoint = "$env:MAPPED_TOKEN_ENDPOINT" + accessToken = "$(ACCESS_TOKEN)" + refreshToken = "$(REFRESH_TOKEN)" + tokenEndpoint = "$(TOKEN_ENDPOINT)" scopes = @("https://www.googleapis.com/auth/userinfo.email","openid") - expiration = $env:MAPPED_EXPIRATION + expiration = $(EXPIRATION) } | ConvertTo-Json | Out-File "credentials.json" - env: - MAPPED_ACCESS_TOKEN: $(ACCESS_TOKEN) - MAPPED_REFRESH_TOKEN: $(REFRESH_TOKEN) - MAPPED_TOKEN_ENDPOINT: $(TOKEN_ENDPOINT) - MAPPED_EXPIRATION: $(EXPIRATION) - task: CmdLine@2 displayName: 'Dry run publish' @@ -172,17 +167,12 @@ stages: cd .pub-cache/ $credentials = @{ - accessToken = "$env:MAPPED_ACCESS_TOKEN" - refreshToken = "$env:MAPPED_REFRESH_TOKEN" - tokenEndpoint = "$env:MAPPED_TOKEN_ENDPOINT" + accessToken = "$(ACCESS_TOKEN)" + refreshToken = "$(REFRESH_TOKEN)" + tokenEndpoint = "$(TOKEN_ENDPOINT)" scopes = @("https://www.googleapis.com/auth/userinfo.email","openid") - expiration = $env:MAPPED_EXPIRATION + expiration = $(EXPIRATION) } | ConvertTo-Json | Out-File "credentials.json" - env: - MAPPED_ACCESS_TOKEN: $(ACCESS_TOKEN) - MAPPED_REFRESH_TOKEN: $(REFRESH_TOKEN) - MAPPED_TOKEN_ENDPOINT: $(TOKEN_ENDPOINT) - MAPPED_EXPIRATION: $(EXPIRATION) - task: CmdLine@2 displayName: 'Dry run publish'