GetCustomArgument() public static method

public static GetCustomArgument ( string argumentName ) : string
argumentName string
return string
Example #1
0
    static void CommandLineBuildOnCheckinIOS()
    {
        const BuildTarget target = BuildTarget.iPhone;

        // Get build scenes.
        string[]           levels           = GetBuildScenes();
        const string       locationPathName = "iOSbuild";
        const BuildOptions options          = BuildOptions.None;

        // Get command line arguments (if passed in to build job).
        CommandLineData commandLineData = GetCommandLineData(IoSdefaultBundleId);


        PlayerSettings.iOS.scriptCallOptimization = ScriptCallOptimizationLevel.FastButNoExceptions;

        var shortBundleVersion = CommandLineReader.GetCustomArgument("ShortBundleVersion");

        if (shortBundleVersion == String.Empty)
        {
            shortBundleVersion = commandLineData.BuildVersion;
        }

        PlayerSettings.shortBundleVersion = shortBundleVersion;


        if (commandLineData.StreamingAssetsEnabled == "true")
        {
            BuildPipelineBuildAssetBundle(BuildTarget.iPhone);
            DeleteMasterAssetResources();
        }

        // Build all scenes.
        BuildPipelineBuildPlayer(levels, locationPathName, target, options, commandLineData);
    }
Example #2
0
    public static void BuildAndroid()
    {
        //mine custom arguments from commandline
        PlayerSettings.keyaliasPass         = CommandLineReader.GetCustomArgument("keystorePass");
        PlayerSettings.keystorePass         = CommandLineReader.GetCustomArgument("keystorePass");
        PlayerSettings.Android.keyaliasName = CommandLineReader.GetCustomArgument("keyAlias");
        PlayerSettings.Android.keyaliasPass = CommandLineReader.GetCustomArgument("keystorePass");
        PlayerSettings.Android.keystoreName = CommandLineReader.GetCustomArgument("keystoreName");
        PlayerSettings.Android.keystorePass = CommandLineReader.GetCustomArgument("keystorePass");
        string bundleVersionCode = CommandLineReader.GetCustomArgument("bundleVersionCode");

        PlayerSettings.Android.bundleVersionCode = Convert.ToInt32(bundleVersionCode);
        PlayerSettings.bundleVersion             = CommandLineReader.GetCustomArgument("bundleVersion");
        PlayerSettings.bundleIdentifier          = CommandLineReader.GetCustomArgument("bundleId");

        Debug.Log("Build android:");
        Debug.Log("   keystoreName:" + PlayerSettings.Android.keystoreName);
        Debug.Log("   keyaliasName:" + PlayerSettings.Android.keyaliasName);
        Debug.Log("   bundleVersion:" + PlayerSettings.bundleVersion);
        Debug.Log("   bundleVersionCode:" + PlayerSettings.Android.bundleVersionCode);
        Debug.Log("   bundleIdentifier:" + PlayerSettings.bundleIdentifier);

        string[] levels  = FindEnabledEditorScenes();
        string   product = CommandLineReader.GetCustomArgument("product", "SWCCG") + ".apk";
        string   path    = "Builds/Devices/Android/" + product;

        BuildOptions opts = BuildOptions.None;

        BuildPipeline.BuildPlayer(levels, path, BuildTarget.Android, opts);
    }
Example #3
0
    static string GetMobileRepoPath()
    {
        string path = CommandLineReader.GetCustomArgument("mobile.repo");

        if (path == "")
        {
            Debug.Log("no CLI arg for path");
            path = EditorPrefs.GetString(KONG_DIR_PREF_KEY, kongMobileDir);
        }
        Debug.Log("using path " + path);
        return(path);
    }
Example #4
0
    private static CommandLineData GetCommandLineData(string defaultBundleId)
    {
        string environment = CommandLineReader.GetCustomArgument("GameServer");
        string svnrevision = CommandLineReader.GetCustomArgument("SvnRevision");
        string version     = CommandLineReader.GetCustomArgument("Version");

        // Opportunity to override the default bundle ID.
        string overrideBundleId       = CommandLineReader.GetCustomArgument("BundleID");
        string streamingAssetsEnabled = CommandLineReader.GetCustomArgument("StreamingAssetsEnabled");
        string bundleId = (0 == overrideBundleId.Length) ? defaultBundleId : overrideBundleId;

        return(new CommandLineData(environment, svnrevision, version, bundleId, streamingAssetsEnabled));
    }
Example #5
0
    static void ExportAndroidProject()
    {
        string output       = "BuildAndroid/";
        string keyaliasPass = CommandLineReader.GetCustomArgument("keyaliasPass");
        string keystorePass = CommandLineReader.GetCustomArgument("keystorePass");

        if (Directory.Exists("BuildAndroid/" + BuildName + "/assets/bin") == true)
        {
            Directory.Delete("BuildAndroid/" + BuildName + "/assets/bin", true);
        }

        GenericBuild(PackageScenes, output, BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer);
    }
Example #6
0
    static void PerformMacOSXBuild()
    {
        string buildPath   = CommandLineReader.GetCustomArgument("path");
        bool   appendBuild = CommandLineReader.GetCustomArgument("append") == "true";

        if (appendBuild)
        {
            GenericBuild(SCENES, buildPath, BuildTarget.iOS, BuildOptions.AcceptExternalModificationsToPlayer);
        }
        else
        {
            GenericBuild(SCENES, buildPath, BuildTarget.iOS, BuildOptions.None);
        }
    }
Example #7
0
    public static void BuildIOS()
    {
        //mine custom arguments from commandline
        PlayerSettings.bundleVersion          = CommandLineReader.GetCustomArgument("bundleVersion", "1.0.0");
        PlayerSettings.bundleIdentifier       = CommandLineReader.GetCustomArgument("bundleId");
        PlayerSettings.iPhoneBundleIdentifier = CommandLineReader.GetCustomArgument("bundleId");

        Debug.Log("Build iOS:");
        Debug.Log("   bundleVersion:" + PlayerSettings.bundleVersion + " bundleId:" + PlayerSettings.iPhoneBundleIdentifier);

        string[] levels = FindEnabledEditorScenes();
        string   path   = "Builds/Devices/IOS";

        BuildOptions opts = BuildOptions.SymlinkLibraries;

        BuildPipeline.BuildPlayer(levels, path, BuildTarget.iPhone, opts);
    }
    static void Init()
    {
        exportDir = CommandLineReader.GetCustomArgument("exportDir");
        UnityEditor.PlayerSettings.applicationIdentifier        = CommandLineReader.GetCustomArgument("applicationIdentifier");
        UnityEditor.PlayerSettings.companyName                  = CommandLineReader.GetCustomArgument("companyName");
        UnityEditor.PlayerSettings.productName                  = CommandLineReader.GetCustomArgument("productName");
        UnityEditor.PlayerSettings.bundleVersion                = CommandLineReader.GetCustomArgument("bundleVersion");
        UnityEditor.PlayerSettings.iOS.buildNumber              = CommandLineReader.GetCustomArgument("iOS.buildNumber");
        UnityEditor.PlayerSettings.Android.bundleVersionCode    = int.Parse(CommandLineReader.GetCustomArgument("Android.bundleVersionCode"));
        UnityEditor.PlayerSettings.Android.keystorePass         = CommandLineReader.GetCustomArgument("Android.keystorePass");
        UnityEditor.PlayerSettings.Android.keyaliasName         = CommandLineReader.GetCustomArgument("Android.keyaliasName");
        UnityEditor.PlayerSettings.Android.keyaliasPass         = CommandLineReader.GetCustomArgument("Android.keyaliasPass");
        UnityEditor.PlayerSettings.Android.useAPKExpansionFiles = bool.Parse(CommandLineReader.GetCustomArgument("Android.useAPKExpansionFiles"));

        UnityEditor.PlayerSettings.SetScriptingDefineSymbolsForGroup(UnityEditor.BuildTargetGroup.iOS, CommandLineReader.GetCustomArgument("iOS.ScriptingDefineSymbols"));
        UnityEditor.PlayerSettings.SetScriptingDefineSymbolsForGroup(UnityEditor.BuildTargetGroup.Android, CommandLineReader.GetCustomArgument("Android.ScriptingDefineSymbols"));
    }
Example #9
0
    private static void CommandLineBuildOnCheckinAndroid()
    {
        const BuildTarget target = BuildTarget.Android;

        // Get build scenes.
        string[]           levels           = GetBuildScenes();
        string             locationPathName = CommandLineReader.GetCustomArgument("APKPath");
        const BuildOptions options          = BuildOptions.None;


        // Android specific command line arguments parsed first.
        string versionCode = CommandLineReader.GetCustomArgument("VersionCode");
        int    verCode;

        if (Int32.TryParse(versionCode, out verCode))
        {
            PlayerSettings.Android.bundleVersionCode = verCode;
        }

        // Get command line arguments (if passed in to build job).
        CommandLineData commandLineData = GetCommandLineData(AndroidDefaultBundleId);

        string homeDirectory = CommandLineReader.GetCustomArgument("HomeDirectory");

        if (!homeDirectory.EndsWith("Assets"))
        {
            homeDirectory += "\\Assets";
        }

        //ensure deployment script is up to date with correct version code and bundle info.
        string apkName = Path.GetFileNameWithoutExtension(locationPathName);

        //WriteVersionCodeAndAPKNameToScript(commandLineData.Environment, verCode, apkName, homeDirectory);

        if (commandLineData.StreamingAssetsEnabled == "true")
        {
            BuildPipelineBuildAssetBundle(BuildTarget.Android);
            DeleteMasterAssetResources();
        }


        // Build all scenes.
        BuildPipelineBuildPlayer(levels, locationPathName, target, options, commandLineData);
    }
Example #10
0
    static void SetVersion()
    {
        string version = CommandLineReader.GetCustomArgument("mobile.sdk.version");

        if (version != "")
        {
            PlayerSettings.bundleVersion = version;
        }
        string tag = CommandLineReader.GetCustomArgument("mobile.sdk.tag");

        if (tag != "")
        {
            PlayerSettings.productName = "AngryBots-" + tag;
        }
        else
        {
            PlayerSettings.productName = "AngryBots";
        }
    }
Example #11
0
    static void PerformBuild()
    {
        string outDir     = string.Empty;
        string configFile = string.Empty;

        outDir     = CommandLineReader.GetCustomArgument("out");
        configFile = CommandLineReader.GetCustomArgument("config");

        string[] scenes = { "Assets/Scenes/Main.unity" };
        BuildPipeline.BuildPlayer(scenes, outDir + "/BuiltGame.exe", BuildTarget.StandaloneWindows, BuildOptions.None);

        // Run the game (Process class from System.Diagnostics).
        Process proc = new Process();

        proc.StartInfo.FileName  = outDir + "/BuiltGame.exe";
        proc.StartInfo.Arguments = "-config " + configFile + " -name player1";
        proc.Start();

        Process proc2 = new Process();

        proc2.StartInfo.FileName  = outDir + "/BuiltGame.exe";
        proc2.StartInfo.Arguments = "-config " + configFile + " -name player2";
        proc2.Start();
    }
 public static void EntryPoint()
 {
     Debug.Log("Language ->" + CommandLineReader.GetCustomArgument("Language"));
     Debug.Log("Version ->" + CommandLineReader.GetCustomArgument("Version"));
 }