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); }
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; }
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); } }
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()); }
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); }
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); }
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); }
public override void Execute(IUniBuilderConfiguration buildParameters) { foreach (var asset in assets) { if (!asset) { continue; } var assetPath = AssetDatabase.GetAssetPath(asset); AssetDatabase.ImportAsset(assetPath, ImportAssetOptions); } }
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); }
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); }
public override void Execute(IUniBuilderConfiguration configuration) { foreach (var command in commands) { foreach (var buildCommand in command.GetCommands()) { if (!buildCommand.IsActive) { continue; } buildCommand.Execute(configuration); } } }
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)); }
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); }
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); }
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)); }
public override void Execute(IUniBuilderConfiguration configuration) { command.Execute(); }
public override void Execute(IUniBuilderConfiguration buildParameters) { Execute(); }
public abstract void Execute(IUniBuilderConfiguration buildParameters);
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; }
public abstract void Execute(IUniBuilderConfiguration configuration);
protected virtual bool ValidatePlatform(IUniBuilderConfiguration config) { return(true); }