1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-03 00:53:27 +00:00

convert publisher to netcoreapp

This commit is contained in:
Kyle Spearrin
2017-12-14 10:54:51 -05:00
parent 919df1edd5
commit 9f3368ba1f
6 changed files with 74 additions and 184 deletions

View File

@@ -1,15 +1,15 @@
using System;
using System.Threading.Tasks;
using Google.Apis.AndroidPublisher.v2;
using Google.Apis.Services;
using System.Collections.Generic;
using Google.Apis.AndroidPublisher.v2;
using Google.Apis.AndroidPublisher.v2.Data;
using System.IO;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace Bit.Publisher
{
class Program
public class Program
{
private const string Package = "com.x8bit.bitwarden";
@@ -81,10 +81,7 @@ namespace Bit.Publisher
Apk apk = null;
using(var stream = new FileStream(_apkFilePath, FileMode.Open))
{
var uploadMedia = service.Edits.Apks.Upload(
Package,
edit.Id,
stream,
var uploadMedia = service.Edits.Apks.Upload(Package, edit.Id, stream,
"application/vnd.android.package-archive");
var progress = await uploadMedia.UploadAsync();
@@ -100,21 +97,16 @@ namespace Bit.Publisher
Console.WriteLine("Version code {0} has been uploaded.", apk.VersionCode);
var trackRequest = service.Edits.Tracks.Update(
new Track
{
VersionCodes = new List<int?> { apk.VersionCode }
},
Package,
edit.Id,
_track);
var updatedTrack = await trackRequest.ExecuteAsync();
var trackRequest = service.Edits.Tracks.Update(new Track
{
VersionCodes = new List<int?> { apk.VersionCode }
}, Package, edit.Id, _track);
var updatedTrack = await trackRequest.ExecuteAsync();
Console.WriteLine("Track {0} has been updated.", updatedTrack.TrackValue);
var commitRequest = service.Edits.Commit(Package, edit.Id);
var commitEdit = await commitRequest.ExecuteAsync();
Console.WriteLine("App edit with id {0} has been comitted.", commitEdit.Id);
}
}