Exemplo n.º 1
0
        public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
        {
            StringBuilder defines = new StringBuilder(BuildProject.GenerateDefaultDefines(releaseType, platform, architecture, distribution));

            if (!string.IsNullOrEmpty(removeDefines))
            {
                string   resolvedRemove = BuildProject.ResolvePath(removeDefines, releaseType, platform, architecture, distribution, buildTime);
                string[] splitRemove    = resolvedRemove.Split(';');

                for (int i = 0; i < splitRemove.Length; i++)
                {
                    defines.Replace(splitRemove[i] + ";", "");
                    defines.Replace(splitRemove[i], "");
                }
            }

            if (!string.IsNullOrEmpty(addDefines))
            {
                string resolvedAdd = BuildProject.ResolvePath(addDefines, releaseType, platform, architecture, distribution, buildTime);

                if (defines.Length > 0)
                {
                    defines.Append(";" + resolvedAdd);
                }
                else
                {
                    defines.Append(resolvedAdd);
                }
            }

            PlayerSettings.SetScriptingDefineSymbolsForGroup(platform.targetGroup, defines.ToString());
        }
        public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
        {
            string resolvedScriptPath = BuildProject.ResolvePath(scriptPath, releaseType, platform, architecture, distribution, buildTime);
            string resolvedScriptArgs = BuildProject.ResolvePath(scriptArguments, releaseType, platform, architecture, distribution, buildTime);

            RunScript(resolvedScriptPath, resolvedScriptArgs);
        }
Exemplo n.º 3
0
 public static string ResolvePerBuildPath(string prototype, BuildReleaseType releaseType, BuildPlatform buildPlatform, BuildArchitecture arch, BuildDistribution dist, DateTime buildTime, string buildPath)
 {
     return(BuildProject.ResolvePath(
                prototype
                .Replace("$BUILDPATH", buildPath)
                .Replace("$BASEPATH", BuildSettings.basicSettings.baseBuildFolder),
                releaseType, buildPlatform, arch, dist, buildTime));
 }
        public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref UnityEditor.BuildOptions options, string configKey, string buildPath)
        {
            string resolvedOutputPath = Path.Combine(outputPath.Replace("$BUILDPATH", buildPath), outputFileName);

            resolvedOutputPath = BuildProject.ResolvePath(resolvedOutputPath, releaseType, platform, architecture, distribution, buildTime);

            string resolvedInputPath = inputPath.Replace("$BUILDPATH", buildPath);

            resolvedInputPath = BuildProject.ResolvePath(resolvedInputPath, releaseType, platform, architecture, distribution, buildTime);

            if (!resolvedOutputPath.EndsWith(".zip"))
            {
                resolvedOutputPath += ".zip";
            }

            PerformZip(Path.GetFullPath(resolvedInputPath), Path.GetFullPath(resolvedOutputPath));
        }
Exemplo n.º 5
0
        public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
        {
            string resolvedInputPath  = BuildProject.ResolvePath(inputPath.Replace("$BUILDPATH", buildPath), releaseType, platform, architecture, distribution, buildTime);
            string resolvedOutputPath = BuildProject.ResolvePath(outputPath.Replace("$BUILDPATH", buildPath), releaseType, platform, architecture, distribution, buildTime);

            switch (operation)
            {
            case Operation.Copy:
                Copy(resolvedInputPath, resolvedOutputPath);
                break;

            case Operation.Move:
                Move(resolvedInputPath, resolvedOutputPath);
                break;

            case Operation.Delete:
                Delete(resolvedInputPath);
                break;
            }

            AssetDatabase.Refresh();
        }
Exemplo n.º 6
0
    public override void PerBuildExecute(BuildReleaseType releaseType, BuildPlatform platform, BuildArchitecture architecture, BuildDistribution distribution, System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
    {
        // Verify that butler executable exists.
        if (!File.Exists(pathTGJPushExe))
        {
            UnityEngine.Debug.LogError("Couldn't find gjpush.exe file at path \"" + pathTGJPushExe + "\", please check provided path");
            return;
        }

        string resolvedOutputPath = Path.Combine(outputPath.Replace("$BUILDPATH", buildPath), outputFileName);

        resolvedOutputPath = BuildProject.ResolvePath(resolvedOutputPath, releaseType, platform, architecture, distribution, buildTime);

        if (!resolvedOutputPath.EndsWith(".zip"))
        {
            resolvedOutputPath += ".zip";
        }

        buildPath = Path.GetFullPath(buildPath);
        string zip = Path.GetFullPath(resolvedOutputPath);

        PerformZip(Path.GetFullPath(buildPath), Path.GetFullPath(resolvedOutputPath));

        // Generate build args for the form: butler push {optional args} {build path} {itch username}/{itch game}:{channel}
        StringBuilder scriptArguments = new StringBuilder("");

        scriptArguments.Append(string.Format("-r {0} ", BuildSettings.productParameters.lastGeneratedVersion));

        scriptArguments.Append("-g " + gameID + " -p " + packageID + " ");
        if (BrowserBuild)
        {
            scriptArguments.Append("-b ");
        }
        scriptArguments.Append("\"" + zip + "\"");

        // UnityEngine.Debug.Log("Would have run itch uploader with following command line: \"" + pathToButlerExe + " " + scriptArguments + "\"");
        UnityEngine.Debug.Log(scriptArguments.ToString());
        RunScript(pathTGJPushExe, scriptArguments.ToString());
    }