2023-04-21 23:16:26 +08:00

103 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using System;
using BF;
namespace BFEditor.Build
{
[Serializable]
public class BuildInfoCollection
{
public List<BuildInfo> infos = new List<BuildInfo>();
public BuildInfo GetFirstInfo()
{
if (infos.Count > 0)
{
return infos[0];
}
return null;
}
}
[Serializable]
public class BuildInfo
{
public string bundleName; // 包名
public string version; // 版本号
public string mode; // 渠道名_debug 或 渠道名_release
public int version_code = 1; // 各自渠道的version_code
public List<BulidGitInfo> git_info; // 打包的git信息
[NonSerialized]
public bool skipVersion = false; // 是否跳过版本校验
public bool IsGPChannel()
{
return bundleName == "com.juzu.b6.publish.android";
}
public bool IsGPOfficial()
{
return bundleName == "com.juzu.b6.publish.android";
}
// dev包使用mono编译不会导出as工程
public bool IsDevChannel()
{
return bundleName == "com.juzu.b6.dev" || bundleName == "com.juzu.b6.dev.android" ||
bundleName == "com.juzu.b6.dev.ios";
}
public bool IsReleaseChannel()
{
return !IsDevChannel();
}
// 是否是内网release
public bool IsLanRelease()
{
return bundleName == "com.juzu.b6.release.android" || bundleName == "com.juzu.b6.release.ios";
}
public bool IsPublish()
{
return !IsDevChannel() && !IsLanRelease();
}
public bool IsIOSPlatform()
{
return bundleName.Contains("ios");
}
public bool IsAndroidPlatform()
{
return !IsIOSPlatform();
}
public string GetBundleName()
{
return bundleName;
}
public string GetVersion()
{
return version;
}
public BFLanguageInfo GetLanguageInfo()
{
var languageInfo = BFPlatform.GetLanguageInfo(bundleName);
return languageInfo;
}
}
[Serializable]
public class BulidGitInfo
{
public string project_name;
public string branch;
public string hash;
}
}