public override void Execute(IUniBuilderConfiguration configuration)
        {
            settings.Validate();

            var buildParameters    = configuration.BuildParameters;
            var outputArtifactPath = buildParameters.ArtifactPath;

            Debug.Log($"{nameof(GooglePlayDistributionCommand)} : Upload {outputArtifactPath}");

            if (!File.Exists(outputArtifactPath))
            {
                Debug.LogError($"Artifact not found {outputArtifactPath}");
                return;
            }

            settings.artifactPath = outputArtifactPath;
            settings.packageName  = PlayerSettings.applicationIdentifier;
            settings.releaseName  = PlayerSettings.bundleVersion;

            var androidPublisher = new PlayStorePublisher();

            androidPublisher.Publish(settings);

            Publish(settings);
        }
예제 #2
0
        public override void Execute(IUniBuilderConfiguration buildParameters)
        {
            var outputFilename  = buildParameters.BuildParameters.OutputFile;
            var outputExtension = string.IsNullOrEmpty(artifactExtension)?
                                  Path.GetExtension(outputFilename) : artifactExtension;

            var fileName = Path.GetFileNameWithoutExtension(outputFilename);

            var artifactName = useProductName ?
                               PlayerSettings.productName :
                               fileName;

            if (useNameTemplate)
            {
                artifactName = string.Format(artifactNameTemplate, artifactName);
            }

            if (includeGitBranch)
            {
                var branch = GitCommands.GetGitBranch();
                if (string.IsNullOrEmpty(branch) == false)
                {
                    artifactName = string.Format(nameFormatTemplate, artifactName, branch);
                }
            }

            if (includeBundleVersion)
            {
                artifactName = string.Format(nameFormatTemplate, artifactName, PlayerSettings.bundleVersion);
            }

            artifactName += $"{outputExtension}";
            buildParameters.BuildParameters.OutputFile = artifactName;
        }
예제 #3
0
        public override void Execute(IUniBuilderConfiguration configuration)
        {
            var buildParameters = configuration.BuildParameters;
            var branch          = appendBranch ? configuration.BuildParameters.Branch : null;

            UpdateBuildVersion(buildParameters.BuildTarget, buildParameters.BuildNumber, branch);
        }
 private void ExecuteCommands(IUniBuilderConfiguration configuration)
 {
     foreach (var buildCommand in commands.Commands)
     {
         buildCommand.Execute(configuration);
     }
 }
예제 #5
0
        private EditorBuildSettingsScene[] GetBuildInScenes(IUniBuilderConfiguration configuration)
        {
            var parameters = configuration.BuildParameters;
            var scenes     = parameters.Scenes.Count > 0 ? parameters.Scenes :
                             EditorBuildSettings.scenes;

            return(scenes.Where(x => x.enabled).ToArray());
        }
예제 #6
0
        public void ExecuteCommands <TTarget>(
            IUniBuilderConfiguration configuration,
            Action <TTarget> action)
            where  TTarget : Object, IUnityBuildCommand
        {
            var commandMap = SelectActualBuildMap(configuration);

            ExecuteCommands(configuration, commandMap, action);
        }
        public override void Execute(IUniBuilderConfiguration configuration)
        {
            if (!configuration.Arguments.GetStringValue(definesKey, out var defineValues))
            {
                defineValues = string.Empty;
            }

            Execute(defineValues);
        }
예제 #8
0
        public BuildReport Build(IUniBuilderConfiguration configuration, IUniBuildCommandsMap commandsMap)
        {
            ExecuteCommands <IUnityPreBuildCommand>(configuration, commandsMap, x => x.Execute(configuration));

            var result = ExecuteBuild(configuration);

            ExecuteCommands <IUnityPostBuildCommand>(configuration, commandsMap, x => x.Execute(configuration, result));

            return(result);
        }
예제 #9
0
        public bool ValidateCommand(IUniBuilderConfiguration configuration, IUnityBuildCommand command)
        {
            var asset   = command;
            var isValid = asset != null && asset.IsActive;

            if (asset is IUnityBuildCommandValidator validator)
            {
                isValid = isValid && validator.Validate(configuration);
            }
            return(isValid);
        }
        public BuildReport Build(IUniBuilderConfiguration configuration, IUniBuildCommandsMap commandsMap)
        {
            ExecuteCommands(commandsMap.PreBuildCommands, x => x.Execute(configuration));

            var result = ExecuteBuild(configuration);

            configuration.BuildReport = result;

            ExecuteCommands(commandsMap.PostBuildCommands, x => x.Execute(configuration));

            return(result);
        }
예제 #11
0
 public override void Execute(IUniBuilderConfiguration buildParameters)
 {
     foreach (var asset in assets)
     {
         if (!asset)
         {
             continue;
         }
         var assetPath = AssetDatabase.GetAssetPath(asset);
         AssetDatabase.ImportAsset(assetPath, ImportAssetOptions);
     }
 }
예제 #12
0
        public override void Execute(IUniBuilderConfiguration configuration)
        {
#if UNITY_CLOUD_BUILD
            return;
#endif
            if (configuration.BuildParameters.EnvironmentType == BuildEnvironmentType.UnityCloudBuild)
            {
                Debug.Log("Skipped in UnityCloudBuild environment");
                return;
            }

            UpdateAndroidBuildParameters(configuration.Arguments);
        }
예제 #13
0
        public void ExecuteCommands <TTarget>(
            IUniBuilderConfiguration configuration,
            IUniBuildCommandsMap commandsMap,
            Action <TTarget> action)
            where  TTarget : IUnityBuildCommand
        {
            LogBuildStep($"ExecuteCommands: \n {configuration.ToString()}");

            var assetResources = commandsMap.
                                 LoadCommands <TTarget>(x => ValidateCommand(configuration, x)).
                                 ToList();

            ExecuteCommands(assetResources, action);
        }
예제 #14
0
 public override void Execute(IUniBuilderConfiguration configuration)
 {
     foreach (var command in commands)
     {
         foreach (var buildCommand in command.GetCommands())
         {
             if (!buildCommand.IsActive)
             {
                 continue;
             }
             buildCommand.Execute(configuration);
         }
     }
 }
예제 #15
0
        public bool Validate(IUniBuilderConfiguration config)
        {
            var buildParameters = config.BuildParameters;

            if (BuildData.BuildTarget != buildParameters.BuildTarget)
            {
                return(false);
            }

            if (BuildData.BuildTargetGroup != buildParameters.BuildTargetGroup)
            {
                return(false);
            }

            return(ValidatePlatform(config));
        }
예제 #16
0
        private BuildReport ExecuteBuild(IUniBuilderConfiguration configuration)
        {
            var scenes = GetBuildInScenes(configuration);

            var buildParameters = configuration.BuildParameters;
            var outputLocation  = GetTargetBuildLocation(configuration.BuildParameters);
            var buildOptions    = buildParameters.BuildOptions;

            LogBuildStep($"OUTPUT LOCATION : {outputLocation}");

            var report = BuildPipeline.BuildPlayer(scenes, outputLocation,
                                                   buildParameters.BuildTarget, buildOptions);

            LogBuildStep(report.ReportMessage());

            return(report);
        }
예제 #17
0
        public override void Execute(IUniBuilderConfiguration configuration)
        {
            var enumBuildOptionsParser = new EnumArgumentParser <BuildOptions>();
            var buildOptions           = enumBuildOptionsParser.Parse(configuration.Arguments);
            var options = BuildOptions.None;

            for (int i = 0; i < buildOptions.Count; i++)
            {
                options |= buildOptions[i];
            }

            foreach (var buildValue in _buildOptions)
            {
                options |= buildValue;
            }

            configuration.BuildParameters.SetBuildOptions(options, false);
        }
예제 #18
0
        public IUniBuildCommandsMap SelectActualBuildMap(IUniBuilderConfiguration configuration)
        {
            //load build command maps
            var commandsMapsResources = AssetEditorTools.
                                        GetEditorResources <UniBuildCommandsMap>();

            //filter all valid commands map
            foreach (var mapResource in commandsMapsResources)
            {
                var commandMap = mapResource.Load <IUniBuildCommandsMap>();
                if (!commandMap.Validate(configuration))
                {
                    continue;
                }

                LogBuildStep($"SELECT BUILD MAP {commandMap.ItemName}");
                return(commandMap);
            }

            return(null);
        }
    public override void Execute(IUniBuilderConfiguration configuration)
    {
#if UNITY_CLOUD_BUILD
        return;
#endif
        var artifactPath     = configuration.BuildParameters.ArtifactPath;
        var buildParameters  = configuration.BuildParameters;
        var buildTargetGroup = buildParameters.BuildTarget;

        if (buildTargetGroup != BuildTarget.Android)
        {
            return;
        }

        if (string.IsNullOrEmpty(artifactPath))
        {
            Debug.LogWarning($"{nameof(RezipAndroidDebugSymbolsCommand)} ArtifactPath is NULL");
            return;
        }

        Execute(artifactPath, androidArchitecture);
    }
        public override void Execute(IUniBuilderConfiguration configuration)
        {
            var arguments       = configuration.Arguments;
            var buildParameters = configuration.BuildParameters;

            var scriptingBackend = arguments.Contains(l2cppEnabled) ?
                                   ScriptingImplementation.IL2CPP :
                                   _defaultBackend;

#if FORCE_MONO
            scriptingBackend = ScriptingImplementation.Mono2x;
#elif FORCE_IL2CPP
            scriptingBackend = ScriptingImplementation.IL2CPP;
#endif

            switch (buildParameters.BuildTargetGroup)
            {
            case BuildTargetGroup.Standalone:
            case BuildTargetGroup.Android:
                PlayerSettings.SetScriptingBackend(buildParameters.BuildTargetGroup, scriptingBackend);
                Debug.Log($"Set ScriptingBackend: {scriptingBackend}");
                return;
            }
        }
 public override void Execute(IUniBuilderConfiguration configuration)
 {
     UniEditorProfiler.LogTime($"===BUILD COMMAND {Name} ===", () => ExecuteCommands(configuration));
 }
예제 #22
0
 public override void Execute(IUniBuilderConfiguration configuration)
 {
     command.Execute();
 }
예제 #23
0
 public override void Execute(IUniBuilderConfiguration buildParameters)
 {
     Execute();
 }
예제 #24
0
 public abstract void Execute(IUniBuilderConfiguration buildParameters);
예제 #25
0
 public virtual bool Validate(IUniBuilderConfiguration config) => isActive;
 public override void Execute(IUniBuilderConfiguration configuration) => Upload();
        public override void Execute(IUniBuilderConfiguration configuration)
        {
            var buildParameters = configuration.BuildParameters;

            PlayerSettings.SetManagedStrippingLevel(buildParameters.BuildTargetGroup, _managedStrippingLevel);
        }
 public override void Execute(IUniBuilderConfiguration buildParameters)
 {
     PlayerSettings.SplashScreen.showUnityLogo = false;
 }
예제 #29
0
 public abstract void Execute(IUniBuilderConfiguration configuration);
예제 #30
0
 protected virtual bool ValidatePlatform(IUniBuilderConfiguration config)
 {
     return(true);
 }