Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Fix build delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
Team-on committed Feb 3, 2020
1 parent cd3539d commit 31d7b8d
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 12 deletions.
26 changes: 15 additions & 11 deletions GGJ/Assets/Editor/BuildPipeline/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
//TODO: publish to itch.io via butler
public static class BuildManager {
//TODO: move to settings that can be changed in editor;
const string butlerRelativePath = @"Thirdparty/Editor/butler/butler.exe";
const string butlerRelativePath = @"Editor/butler/butler.exe";
static string[] channelNames = new string[] {
"windows-32",
"windows-64",
"linux-universal",
"osx-universal",
"webgl",
"android",
//"ios",
//"uwp",
"ios",
"uwp",
};


Expand Down Expand Up @@ -84,6 +84,7 @@ static void BuildAll() {
buildsPath.Add(BuildLinux(true));
buildsPath.Add(BuildOSX(true));
buildsPath.Add(BuildWeb(true));
buildsPath.Add(BuildAndroid(true));

EditorUserBuildSettings.SwitchActiveBuildTarget(targetGroupBeforeStart, targetBeforeStart);
Debug.Log($"End building all. Elapsed time: {string.Format("{0:mm\\:ss}", DateTime.Now - startTime)}");
Expand Down Expand Up @@ -172,8 +173,8 @@ public static string BuildAndroid(bool isInBuildSequence) {
isInBuildSequence ? BuildOptions.None : BuildOptions.ShowBuiltPlayer,
!isInBuildSequence,
!isInBuildSequence,
"",
$"{PlayerSettings.productName}_{PlayerSettings.bundleVersion}.{LastBuildPatch}.apk"
".apk",
$".apk"
);
}

Expand All @@ -183,15 +184,15 @@ public static string BuildIos(bool isInBuildSequence) {
isInBuildSequence ? BuildOptions.None : BuildOptions.ShowBuiltPlayer,
!isInBuildSequence,
!isInBuildSequence,
"",
$"{PlayerSettings.productName}_{PlayerSettings.bundleVersion}.{LastBuildPatch}.ipa"
".ipa",
$".ipa"
);
}

static string BaseBuild(BuildTargetGroup buildTargetGroup, BuildTarget buildTarget, BuildOptions buildOptions, bool needReturnBuildTarget, bool incrementPatch, string folderPath, string buildPath) {
folderPath = folderPath.Replace(' ', '-');
buildPath = buildPath.Replace(' ', '-');
string basePath = $"Builds/{PlayerSettings.productName}_{PlayerSettings.bundleVersion}.{LastBuildPatch}";
string basePath = $"Builds/{PlayerSettings.productName}_{PlayerSettings.bundleVersion}.{LastBuildPatch}".Replace(' ', '-');
BuildTarget targetBeforeStart = EditorUserBuildSettings.activeBuildTarget;
BuildTargetGroup targetGroupBeforeStart = BuildPipeline.GetBuildTargetGroup(targetBeforeStart);

Expand Down Expand Up @@ -237,7 +238,10 @@ static string BaseBuild(BuildTargetGroup buildTargetGroup, BuildTarget buildTarg
public static void Compress(string dirPath) {
using (ZipFile zip = new ZipFile()) {
DateTime startTime = DateTime.Now;
zip.AddDirectory(dirPath);
if(Directory.Exists(dirPath))
zip.AddDirectory(dirPath);
else
zip.AddFile(dirPath);
zip.Save(dirPath + ".zip");

long uncompresedSize = 0;
Expand All @@ -257,13 +261,13 @@ public static void Push(string dirPath, string channelName) {
fileName.Append("/");
fileName.Append(butlerRelativePath);

args.Append("push \"");
args.Append(" push \"");
args.Append(Application.dataPath);
args.Append("/../");
args.Append(dirPath);
args.Append("\" ");

args.Append($"teamon/{PlayerSettings.productName}:{channelName} ");
args.Append($"teamon/{PlayerSettings.productName.Replace(' ', '-')}:{channelName} ");
args.Append($"--userversion {PlayerSettings.bundleVersion}.{LastBuildPatch} ");

Debug.Log(fileName.ToString() + args.ToString());
Expand Down
1 change: 1 addition & 0 deletions GGJ/ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ GraphicsSettings:
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0}
Expand Down
94 changes: 93 additions & 1 deletion GGJ/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,99 @@ PlayerSettings:
m_Width: 128
m_Height: 128
m_Kind: 0
m_BuildTargetPlatformIcons: []
m_BuildTargetPlatformIcons:
- m_BuildTarget: Android
m_Icons:
- m_Textures: []
m_Width: 432
m_Height: 432
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 324
m_Height: 324
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 216
m_Height: 216
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 162
m_Height: 162
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 108
m_Height: 108
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 81
m_Height: 81
m_Kind: 2
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 0
m_SubKind:
- m_Textures: []
m_Width: 192
m_Height: 192
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 144
m_Height: 144
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 96
m_Height: 96
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 72
m_Height: 72
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 48
m_Height: 48
m_Kind: 1
m_SubKind:
- m_Textures: []
m_Width: 36
m_Height: 36
m_Kind: 1
m_SubKind:
m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: AndroidPlayer
Expand Down

0 comments on commit 31d7b8d

Please sign in to comment.