All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openbakery.simulators.SimulatorInstallAppTask.groovy Maven / Gradle / Ivy

Go to download

XCode-Plugin is a plugin to allow custom XCode projects to build as generated by CMake

There is a newer version: 0.0.201
Show newest version
package org.openbakery.simulators

import org.gradle.api.tasks.TaskAction
import org.openbakery.XcodePlugin
import org.openbakery.CommandRunnerException
import org.openbakery.codesign.Codesign
import org.openbakery.codesign.CodesignParameters

class SimulatorInstallAppTask extends AbstractSimulatorTask {

	Codesign codesign

	public SimulatorInstallAppTask() {
		setDescription("Install app on iOS Simulators")
		dependsOn(XcodePlugin.XCODE_BUILD_TASK_NAME)
		dependsOn(XcodePlugin.SIMULATORS_START_TASK_NAME)
	}

	@TaskAction
	void run() {
		try {
			logger.lifecycle("Signing " + project.xcodebuild.applicationBundle.absolutePath)
			getCodesign().sign(project.xcodebuild.applicationBundle)
			logger.lifecycle("Installing " + project.xcodebuild.applicationBundle.absolutePath)
			simulatorControl.simctl("install", "booted", project.xcodebuild.applicationBundle.absolutePath)
		} catch (CommandRunnerException ex) {
			println "Unable to install" + project.xcodebuild.applicationBundle.absolutePath
			throw ex
		}
	}


	Codesign getCodesign() {
		if (!codesign) {
			CodesignParameters parameters = new CodesignParameters()
			parameters.type = project.xcodebuild.type
			codesign = new Codesign(xcode, parameters, commandRunner, plistHelper)
		}
		return codesign
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy