1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 00:03:22 +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,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

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);
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Publisher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Publisher")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("428cacab-cc26-4f41-9062-1e4a9bc82640")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,62 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{428CACAB-CC26-4F41-9062-1E4A9BC82640}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RootNamespace>Bit.Publisher</RootNamespace>
<AssemblyName>Publisher</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<PackageReference Include="Google.Apis.AndroidPublisher.v2" Version="1.31.1.1033" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="play_creds.json.enc" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Apis.AndroidPublisher.v2">
<Version>1.31.1.1033</Version>
</PackageReference>
<PackageReference Include="Zlib.Portable.Signed">
<Version>1.11.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>