From a82f6466f4aabb694ec160817345e45eedbacba8 Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Wed, 30 May 2018 08:41:35 +0100 Subject: [PATCH 1/7] --wip-- [skip ci] --- .../org/openbakery/CommandRunner.groovy | 2 +- .../groovy/org/openbakery/XcodePlugin.groovy | 8 +- .../carthage/AbstractCarthageTaskBase.groovy | 13 +- .../carthage/CarthageBootStrapTask.groovy | 122 +++++++++++++++--- .../carthage/CarthageBootstrapRunnable.groovy | 70 ++++++++++ 5 files changed, 188 insertions(+), 27 deletions(-) create mode 100644 plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy diff --git a/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy b/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy index b52aeeff..86be35ff 100644 --- a/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy +++ b/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy @@ -23,7 +23,7 @@ import org.openbakery.output.OutputAppender import org.slf4j.Logger import org.slf4j.LoggerFactory -class CommandRunner { +class CommandRunner implements Serializable{ private static Logger logger = LoggerFactory.getLogger(CommandRunner.class) diff --git a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy index 60727419..40beeb79 100644 --- a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy +++ b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy @@ -692,7 +692,13 @@ class XcodePlugin implements Plugin { private void configureCarthage(Project project) { project.task(CARTHAGE_CLEAN_TASK_NAME, type: CarthageCleanTask, group: CARTHAGE_GROUP_NAME) project.task(CARTHAGE_UPDATE_TASK_NAME, type: CarthageUpdateTask, group: CARTHAGE_GROUP_NAME) - project.task(CARTHAGE_BOOTSTRAP_TASK_NAME, type: CarthageBootStrapTask, group: CARTHAGE_GROUP_NAME) +// project.task(CARTHAGE_BOOTSTRAP_TASK_NAME, type: CarthageBootStrapTask, group: CARTHAGE_GROUP_NAME) + + project.tasks.create(CARTHAGE_BOOTSTRAP_TASK_NAME, CarthageBootStrapTask.class) { + it.group = CARTHAGE_GROUP_NAME + it.commandRunnerProperty.set(commandRunner) + it.platform.set(xcodeBuildPluginExtension.type) + } } private configureCarthageDependencies(Project project) { diff --git a/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy b/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy index abbb6664..2e70c2be 100644 --- a/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy +++ b/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy @@ -1,10 +1,14 @@ package org.openbakery.carthage +import groovy.transform.CompileStatic import org.gradle.api.provider.Provider import org.gradle.api.tasks.* import org.openbakery.AbstractXcodeTask +import org.openbakery.CommandRunnerException +import org.openbakery.XcodeBuildPluginExtension import org.openbakery.xcode.Type +@CompileStatic abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { static final String ACTION_BOOTSTRAP = "bootstrap" @@ -31,7 +35,6 @@ abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { @InputFile @Optional - @PathSensitive(PathSensitivity.RELATIVE) Provider getCartFile() { // Cf https://github.com/gradle/gradle/issues/2016 File file = project.rootProject.file(CARTHAGE_FILE) @@ -43,7 +46,6 @@ abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { @InputFile @Optional - @PathSensitive(PathSensitivity.RELATIVE) Provider getCartResolvedFile() { // Cf https://github.com/gradle/gradle/issues/2016 File file = project.rootProject.file(CARTHAGE_FILE_RESOLVED) @@ -55,7 +57,7 @@ abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { @Input String getCarthagePlatformName() { - switch (project.xcodebuild.type) { + switch (project.extensions.findByType(XcodeBuildPluginExtension).type.get()) { case Type.iOS: return CARTHAGE_PLATFORM_IOS case Type.tvOS: return CARTHAGE_PLATFORM_TVOS case Type.macOS: return CARTHAGE_PLATFORM_MACOS @@ -65,6 +67,7 @@ abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { } @OutputDirectory + @PathSensitive(PathSensitivity.NAME_ONLY) Provider getOutputDirectory() { return project.provider { project.rootProject.file("Carthage/Build/" + getCarthagePlatformName()) @@ -74,14 +77,14 @@ abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { String getCarthageCommand() { try { return commandRunner.runWithResult("which", "carthage") - } catch (CommandRunnerException) { + } catch (CommandRunnerException exception) { // ignore, because try again with full path below } try { commandRunner.runWithResult("ls", CARTHAGE_USR_BIN_PATH) return CARTHAGE_USR_BIN_PATH - } catch (CommandRunnerException) { + } catch (CommandRunnerException exception) { // ignore, because blow an exception is thrown } throw new IllegalStateException("The carthage command was not found. Make sure that Carthage is installed") diff --git a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy index 7c6e8c43..5938d5d4 100644 --- a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy +++ b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy @@ -1,35 +1,117 @@ package org.openbakery.carthage import groovy.transform.CompileStatic -import org.gradle.api.tasks.TaskAction -import org.gradle.internal.logging.text.StyledTextOutputFactory -import org.openbakery.output.ConsoleOutputAppender +import org.gradle.api.DefaultTask +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.Property +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.* +import org.gradle.workers.IsolationMode +import org.gradle.workers.WorkerConfiguration +import org.gradle.workers.WorkerExecutor +import org.openbakery.CommandRunner +import org.openbakery.xcode.Type +import javax.inject.Inject +import java.util.regex.Pattern + +@CacheableTask @CompileStatic -class CarthageBootStrapTask extends AbstractCarthageTaskBase { +class CarthageBootStrapTask extends DefaultTask { + + @InputFile + @PathSensitive(PathSensitivity.NAME_ONLY) + RegularFileProperty cartFile = project.layout.fileProperty() + + Property platform = project.objects.property(Type) + + @Input + Provider carthagePlatformName = platform.map { + this.typeToCarthagePlatform(it) + } as Provider + + final Property commandRunnerProperty = project.objects.property(CommandRunner) + + final WorkerExecutor workerExecutor + + static final String CARTHAGE_FILE = "Cartfile" + static final String CARTHAGE_PLATFORM_IOS = "iOS" + static final String CARTHAGE_PLATFORM_MACOS = "Mac" + static final String CARTHAGE_PLATFORM_TVOS = "tvOS" + static final String CARTHAGE_PLATFORM_WATCHOS = "watchOS" - CarthageBootStrapTask() { + static final Pattern LINE_PATTERN = ~/^(binary|github|git)\s"([^"^\/]+)\/(([^\/]+)||([^"]+)\/([^"]+).json)"."([^"]+)"$/ + + @Inject + CarthageBootStrapTask(WorkerExecutor workerExecutor) { super() + this.workerExecutor = workerExecutor + setDescription "Check out and build the Carthage project dependencies" + + cartFile.set(new File(project.rootProject.rootDir, "Cartfile.resolved")) + + onlyIf { + return cartFile.asFile.get().exists() + } + } + + @OutputDirectories + Map getOutputFiles() { + HashMap result = new HashMap<>() + cartFile.asFile + .get() + .getText() + .readLines() + .collect { return LINE_PATTERN.matcher(it) } + .findAll { it.matches() } + .collect { it.group(3) } + .each { + result.put(it, new File(project.rootProject.projectDir, + "Carthage/Build/${carthagePlatformName.get()}/${it}.framework")) + } + + return result } @TaskAction void update() { - if (hasCartFile()) { - logger.info('Boostrap Carthage for platform ' + carthagePlatformName) - def output = services.get(StyledTextOutputFactory) - .create(CarthageBootStrapTask) - - List args = [getCarthageCommand(), - ACTION_BOOTSTRAP, - ARG_PLATFORM, - carthagePlatformName, - ARG_CACHE_BUILDS] - - commandRunner.run(project.projectDir.absolutePath, - args, - getRequiredXcodeVersion() != null ? xcode.getXcodeSelectEnvValue(getRequiredXcodeVersion()) : null, - new ConsoleOutputAppender(output)) + logger.warn('Bootstrap Carthage for platform ' + carthagePlatformName) + + List names = cartFile.asFile + .get() + .getText() + .readLines() + .collect { return LINE_PATTERN.matcher(it) } + .findAll { it.matches() } + .collect { it.group(3) } + .each { createWorker(it) } + + workerExecutor.await() + } + + private void createWorker(String source) { + workerExecutor.submit(CarthageBootstrapRunnable.class) { WorkerConfiguration config -> + // Use the minimum level of isolation + config.isolationMode = IsolationMode.PROCESS + + // Constructor parameters for the unit of work implementation + config.params project.rootProject.projectDir, + source, + carthagePlatformName.get(), + commandRunnerProperty.get() + + config.displayName = "Bootstrap " + source + } + } + + private String typeToCarthagePlatform(Type type) { + switch (type) { + case Type.iOS: return CARTHAGE_PLATFORM_IOS + case Type.tvOS: return CARTHAGE_PLATFORM_TVOS + case Type.macOS: return CARTHAGE_PLATFORM_MACOS + case Type.watchOS: return CARTHAGE_PLATFORM_WATCHOS + default: return 'all' } } } diff --git a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy new file mode 100644 index 00000000..932f06fc --- /dev/null +++ b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy @@ -0,0 +1,70 @@ +package org.openbakery.carthage + +import groovy.util.logging.Slf4j +import org.openbakery.CommandRunner +import org.openbakery.CommandRunnerException +import org.openbakery.output.OutputAppender + +import javax.inject.Inject + +@Slf4j +class CarthageBootstrapRunnable implements Runnable { + + static final String ACTION_BOOTSTRAP = "bootstrap" + static final String ARG_PLATFORM = "--platform" + static final String ARG_CACHE_BUILDS = "--cache-builds" + static final String CARTHAGE_USR_BIN_PATH = "/usr/local/bin/carthage" + + final File projectDir + final OutputAppender outputAppender + final String platform + final String source + final CommandRunner commandRunner + + @Inject + CarthageBootstrapRunnable(File projectDir, + String source, + String platform, + CommandRunner commandRunner) { + println "platform : " + platform + assert false + this.projectDir = projectDir + this.source = source + this.platform = platform + this.outputAppender = outputAppender + this.commandRunner = commandRunner + } + + @Override + void run() { + commandRunner.run([getCarthageCommand(), + ACTION_BOOTSTRAP, + "--color", "always", + "--project-directory", "${projectDir.absolutePath}", + ARG_CACHE_BUILDS, + ARG_PLATFORM, platform, + source], + new OutputAppender() { + @Override + void append(String output) { + log.debug(output) + } + }) + } + + String getCarthageCommand() { + try { + return commandRunner.runWithResult("which", "carthage") + } catch (CommandRunnerException exception) { + // ignore, because try again with full path below + } + + try { + commandRunner.runWithResult("ls", CARTHAGE_USR_BIN_PATH) + return CARTHAGE_USR_BIN_PATH + } catch (CommandRunnerException exception) { + // ignore, because blow an exception is thrown + } + throw new IllegalStateException("The carthage command was not found. Make sure that Carthage is installed") + } +} From 4f57ba5d283252a334f2a13204d612146dcfd797 Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Wed, 30 May 2018 15:25:31 +0100 Subject: [PATCH 2/7] Add the carthage bootstrap caching support --- .../groovy/org/openbakery/xcode/Xcode.groovy | 2 +- .../XcodeBuildPluginExtension.groovy | 4 + .../groovy/org/openbakery/XcodePlugin.groovy | 3 +- .../carthage/AbstractCarthageTaskBase.groovy | 2 +- .../carthage/CarthageBootStrapTask.groovy | 143 +++++++++++------- .../carthage/CarthageBootstrapRunnable.groovy | 45 ++---- 6 files changed, 114 insertions(+), 85 deletions(-) diff --git a/libxcode/src/main/groovy/org/openbakery/xcode/Xcode.groovy b/libxcode/src/main/groovy/org/openbakery/xcode/Xcode.groovy index 89f80ad2..274fb4df 100644 --- a/libxcode/src/main/groovy/org/openbakery/xcode/Xcode.groovy +++ b/libxcode/src/main/groovy/org/openbakery/xcode/Xcode.groovy @@ -58,7 +58,7 @@ class Xcode { if (file.exists()) { result.put(ENV_DEVELOPER_DIR, file.absolutePath) } - println file.absolutePath + return result } diff --git a/plugin/src/main/groovy/org/openbakery/XcodeBuildPluginExtension.groovy b/plugin/src/main/groovy/org/openbakery/XcodeBuildPluginExtension.groovy index 4823ee50..207649e8 100644 --- a/plugin/src/main/groovy/org/openbakery/XcodeBuildPluginExtension.groovy +++ b/plugin/src/main/groovy/org/openbakery/XcodeBuildPluginExtension.groovy @@ -35,6 +35,7 @@ class XcodeBuildPluginExtension { final Property bitcode = project.objects.property(Boolean) final Property version = project.objects.property(String) + final Property targetType = project.objects.property(Type) final Property scheme = project.objects.property(String) final DirectoryProperty archiveDirectory = project.layout.directoryProperty() final DirectoryProperty schemeArchiveFile = project.layout.directoryProperty() @@ -108,6 +109,8 @@ class XcodeBuildPluginExtension { this.symRoot.set(project.layout.buildDirectory.dir("sym")) this.sharedPrecompsDir.set(project.layout.buildDirectory.dir("shared")) this.derivedDataPath.set(project.layout.buildDirectory.dir("derivedData")) + + this.targetType.set(Type.iOS) } private void configureServices() { @@ -358,6 +361,7 @@ class XcodeBuildPluginExtension { void setType(String type) { this.type = Type.typeFromString(type) + this.targetType.set(this.type) } Type getType() { diff --git a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy index 40beeb79..4a989c0d 100644 --- a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy +++ b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy @@ -696,8 +696,9 @@ class XcodePlugin implements Plugin { project.tasks.create(CARTHAGE_BOOTSTRAP_TASK_NAME, CarthageBootStrapTask.class) { it.group = CARTHAGE_GROUP_NAME + it.requiredXcodeVersion.set(xcodeBuildPluginExtension.version) it.commandRunnerProperty.set(commandRunner) - it.platform.set(xcodeBuildPluginExtension.type) + it.platform.set(xcodeBuildPluginExtension.targetType) } } diff --git a/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy b/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy index 2e70c2be..d26c96ad 100644 --- a/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy +++ b/plugin/src/main/groovy/org/openbakery/carthage/AbstractCarthageTaskBase.groovy @@ -57,7 +57,7 @@ abstract class AbstractCarthageTaskBase extends AbstractXcodeTask { @Input String getCarthagePlatformName() { - switch (project.extensions.findByType(XcodeBuildPluginExtension).type.get()) { + switch (project.extensions.findByType(XcodeBuildPluginExtension).type) { case Type.iOS: return CARTHAGE_PLATFORM_IOS case Type.tvOS: return CARTHAGE_PLATFORM_TVOS case Type.macOS: return CARTHAGE_PLATFORM_MACOS diff --git a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy index 5938d5d4..dbb86216 100644 --- a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy +++ b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy @@ -1,46 +1,54 @@ package org.openbakery.carthage import groovy.transform.CompileStatic +import org.gradle.api.Action import org.gradle.api.DefaultTask +import org.gradle.api.Transformer import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.Property -import org.gradle.api.provider.Provider import org.gradle.api.tasks.* -import org.gradle.workers.IsolationMode -import org.gradle.workers.WorkerConfiguration +import org.gradle.process.ExecSpec import org.gradle.workers.WorkerExecutor import org.openbakery.CommandRunner +import org.openbakery.CommandRunnerException import org.openbakery.xcode.Type +import org.openbakery.xcode.Xcode import javax.inject.Inject -import java.util.regex.Pattern @CacheableTask @CompileStatic class CarthageBootStrapTask extends DefaultTask { + @Input + @Optional + Property requiredXcodeVersion = project.objects.property(String) + + @Input + Property carthagePlatformName = project.objects.property(String) + @InputFile @PathSensitive(PathSensitivity.NAME_ONLY) RegularFileProperty cartFile = project.layout.fileProperty() - Property platform = project.objects.property(Type) - - @Input - Provider carthagePlatformName = platform.map { - this.typeToCarthagePlatform(it) - } as Provider + @OutputDirectory + Property outputDirectory = project.objects.property(File) + final Property platform = project.objects.property(Type) + final Property xcodeProperty = project.objects.property(Xcode) final Property commandRunnerProperty = project.objects.property(CommandRunner) final WorkerExecutor workerExecutor - static final String CARTHAGE_FILE = "Cartfile" + static final String CARTHAGE_FILE = "Cartfile.resolved" static final String CARTHAGE_PLATFORM_IOS = "iOS" static final String CARTHAGE_PLATFORM_MACOS = "Mac" static final String CARTHAGE_PLATFORM_TVOS = "tvOS" static final String CARTHAGE_PLATFORM_WATCHOS = "watchOS" - - static final Pattern LINE_PATTERN = ~/^(binary|github|git)\s"([^"^\/]+)\/(([^\/]+)||([^"]+)\/([^"]+).json)"."([^"]+)"$/ + static final String CARTHAGE_USR_BIN_PATH = "/usr/local/bin/carthage" + static final String ACTION_BOOTSTRAP = "bootstrap" + static final String ARG_PLATFORM = "--platform" + static final String ARG_CACHE_BUILDS = "--cache-builds" @Inject CarthageBootStrapTask(WorkerExecutor workerExecutor) { @@ -49,60 +57,70 @@ class CarthageBootStrapTask extends DefaultTask { setDescription "Check out and build the Carthage project dependencies" - cartFile.set(new File(project.rootProject.rootDir, "Cartfile.resolved")) + cartFile.set(new File(project.rootProject.rootDir, CARTHAGE_FILE)) + + carthagePlatformName.set(platform.map(new Transformer() { + @Override + String transform(Type type) { + return typeToCarthagePlatform(type) + } + })) + + outputDirectory.set(carthagePlatformName.map(new Transformer() { + @Override + File transform(String platformName) { + return new File(project.rootProject.rootDir, "Carthage/Build/" + platformName) + } + })) + + xcodeProperty.set(commandRunnerProperty.map(new Transformer() { + @Override + Xcode transform(CommandRunner commandRunner) { + return new Xcode(commandRunner) + } + })) onlyIf { return cartFile.asFile.get().exists() } } - @OutputDirectories - Map getOutputFiles() { - HashMap result = new HashMap<>() - cartFile.asFile - .get() - .getText() - .readLines() - .collect { return LINE_PATTERN.matcher(it) } - .findAll { it.matches() } - .collect { it.group(3) } - .each { - result.put(it, new File(project.rootProject.projectDir, - "Carthage/Build/${carthagePlatformName.get()}/${it}.framework")) - } - - return result + public void setXcode(Xcode xcode) { + this.xcode = xcode } @TaskAction void update() { logger.warn('Bootstrap Carthage for platform ' + carthagePlatformName) - - List names = cartFile.asFile - .get() - .getText() - .readLines() - .collect { return LINE_PATTERN.matcher(it) } - .findAll { it.matches() } - .collect { it.group(3) } - .each { createWorker(it) } - - workerExecutor.await() + println "getCarthageCommand : " + getCarthageCommand() + + project.exec(new Action() { + @Override + void execute(ExecSpec execSpec) { + execSpec.args = [ACTION_BOOTSTRAP, + ARG_CACHE_BUILDS, + "--new-resolver", + "--color", "always", + ARG_PLATFORM, + carthagePlatformName.getOrNull().toString()] as List + + execSpec.environment(getEnvValues()) + execSpec.executable = getCarthageCommand() + execSpec.workingDir(project.rootProject.projectDir) + } + }) } - private void createWorker(String source) { - workerExecutor.submit(CarthageBootstrapRunnable.class) { WorkerConfiguration config -> - // Use the minimum level of isolation - config.isolationMode = IsolationMode.PROCESS - - // Constructor parameters for the unit of work implementation - config.params project.rootProject.projectDir, - source, - carthagePlatformName.get(), - commandRunnerProperty.get() - - config.displayName = "Bootstrap " + source + private final Map getEnvValues() { + final Map envValues + if (requiredXcodeVersion.present) { + envValues = xcodeProperty.get() + .getXcodeSelectEnvValue(requiredXcodeVersion.getOrNull()) + } else { + envValues = [:] } + + return envValues } private String typeToCarthagePlatform(Type type) { @@ -114,4 +132,23 @@ class CarthageBootStrapTask extends DefaultTask { default: return 'all' } } + + private String getCarthageCommand() { + try { + return commandRunnerProperty.get() + .runWithResult("which", "carthage") + } catch (CommandRunnerException exception) { + // ignore, because try again with full path below + } + + try { + commandRunnerProperty.get() + .runWithResult("ls", CARTHAGE_USR_BIN_PATH) + return CARTHAGE_USR_BIN_PATH + } catch (CommandRunnerException exception) { + // ignore, because blow an exception is thrown + } + + throw new IllegalStateException("The carthage command was not found. Make sure that Carthage is installed") + } } diff --git a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy index 932f06fc..5e6160a6 100644 --- a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy +++ b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy @@ -1,49 +1,52 @@ package org.openbakery.carthage -import groovy.util.logging.Slf4j +import groovy.util.logging.Log4j import org.openbakery.CommandRunner -import org.openbakery.CommandRunnerException import org.openbakery.output.OutputAppender import javax.inject.Inject -@Slf4j +@Log4j class CarthageBootstrapRunnable implements Runnable { - static final String ACTION_BOOTSTRAP = "bootstrap" - static final String ARG_PLATFORM = "--platform" - static final String ARG_CACHE_BUILDS = "--cache-builds" - static final String CARTHAGE_USR_BIN_PATH = "/usr/local/bin/carthage" + + final CommandRunner commandRunner + final String carthageCommand final File projectDir + final Map environmentValues final OutputAppender outputAppender final String platform final String source - final CommandRunner commandRunner @Inject CarthageBootstrapRunnable(File projectDir, + String carthageCommand, String source, String platform, - CommandRunner commandRunner) { - println "platform : " + platform - assert false + CommandRunner commandRunner, + Map environmentValues) { + this.carthageCommand = carthageCommand this.projectDir = projectDir this.source = source this.platform = platform this.outputAppender = outputAppender this.commandRunner = commandRunner + this.environmentValues = environmentValues } @Override void run() { - commandRunner.run([getCarthageCommand(), + log.debug("Carthage bootstrap source : " + source) + commandRunner.run([carthageCommand, ACTION_BOOTSTRAP, + ARG_CACHE_BUILDS, + "--new-resolver", "--color", "always", "--project-directory", "${projectDir.absolutePath}", - ARG_CACHE_BUILDS, ARG_PLATFORM, platform, source], + environmentValues, new OutputAppender() { @Override void append(String output) { @@ -51,20 +54,4 @@ class CarthageBootstrapRunnable implements Runnable { } }) } - - String getCarthageCommand() { - try { - return commandRunner.runWithResult("which", "carthage") - } catch (CommandRunnerException exception) { - // ignore, because try again with full path below - } - - try { - commandRunner.runWithResult("ls", CARTHAGE_USR_BIN_PATH) - return CARTHAGE_USR_BIN_PATH - } catch (CommandRunnerException exception) { - // ignore, because blow an exception is thrown - } - throw new IllegalStateException("The carthage command was not found. Make sure that Carthage is installed") - } } From be9afa92bc78cd762cee555ab2fa3537cf8bec65 Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Wed, 30 May 2018 15:25:53 +0100 Subject: [PATCH 3/7] The runnable is no more needed --- .../carthage/CarthageBootstrapRunnable.groovy | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy diff --git a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy deleted file mode 100644 index 5e6160a6..00000000 --- a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootstrapRunnable.groovy +++ /dev/null @@ -1,57 +0,0 @@ -package org.openbakery.carthage - -import groovy.util.logging.Log4j -import org.openbakery.CommandRunner -import org.openbakery.output.OutputAppender - -import javax.inject.Inject - -@Log4j -class CarthageBootstrapRunnable implements Runnable { - - - - final CommandRunner commandRunner - final String carthageCommand - final File projectDir - final Map environmentValues - final OutputAppender outputAppender - final String platform - final String source - - @Inject - CarthageBootstrapRunnable(File projectDir, - String carthageCommand, - String source, - String platform, - CommandRunner commandRunner, - Map environmentValues) { - this.carthageCommand = carthageCommand - this.projectDir = projectDir - this.source = source - this.platform = platform - this.outputAppender = outputAppender - this.commandRunner = commandRunner - this.environmentValues = environmentValues - } - - @Override - void run() { - log.debug("Carthage bootstrap source : " + source) - commandRunner.run([carthageCommand, - ACTION_BOOTSTRAP, - ARG_CACHE_BUILDS, - "--new-resolver", - "--color", "always", - "--project-directory", "${projectDir.absolutePath}", - ARG_PLATFORM, platform, - source], - environmentValues, - new OutputAppender() { - @Override - void append(String output) { - log.debug(output) - } - }) - } -} From a35c3a153df1f30e7bc225906f49398eb4982140 Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Wed, 30 May 2018 15:42:52 +0100 Subject: [PATCH 4/7] Cleanup --- plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy index 4a989c0d..bfa6e3c6 100644 --- a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy +++ b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy @@ -692,7 +692,6 @@ class XcodePlugin implements Plugin { private void configureCarthage(Project project) { project.task(CARTHAGE_CLEAN_TASK_NAME, type: CarthageCleanTask, group: CARTHAGE_GROUP_NAME) project.task(CARTHAGE_UPDATE_TASK_NAME, type: CarthageUpdateTask, group: CARTHAGE_GROUP_NAME) -// project.task(CARTHAGE_BOOTSTRAP_TASK_NAME, type: CarthageBootStrapTask, group: CARTHAGE_GROUP_NAME) project.tasks.create(CARTHAGE_BOOTSTRAP_TASK_NAME, CarthageBootStrapTask.class) { it.group = CARTHAGE_GROUP_NAME From 55da6f491fe87dd0a560e8614b08c0519eeddf21 Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Thu, 31 May 2018 10:28:35 +0100 Subject: [PATCH 5/7] Convert the old unit to a functional one --- .../KeychainCreateTaskFunctionalTest.groovy | 8 +- ...CarthageBootStrapTaskFunctionalTest.groovy | 127 +++++++++++++++ ...ovisioningInstallTaskFunctionalTest.groovy | 6 +- .../groovy/org/openbakery/XcodePlugin.groovy | 7 +- .../carthage/CarthageBootStrapTask.groovy | 6 +- .../carthage/CarthageBootStrapTaskTest.groovy | 150 ------------------ 6 files changed, 142 insertions(+), 162 deletions(-) create mode 100644 plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy delete mode 100644 plugin/src/test/groovy/org/openbakery/carthage/CarthageBootStrapTaskTest.groovy diff --git a/plugin/src/functionalTest/groovy/org/openbakery/KeychainCreateTaskFunctionalTest.groovy b/plugin/src/functionalTest/groovy/org/openbakery/KeychainCreateTaskFunctionalTest.groovy index c93801a1..71b02662 100644 --- a/plugin/src/functionalTest/groovy/org/openbakery/KeychainCreateTaskFunctionalTest.groovy +++ b/plugin/src/functionalTest/groovy/org/openbakery/KeychainCreateTaskFunctionalTest.groovy @@ -75,7 +75,7 @@ class KeychainCreateTaskFunctionalTest extends Specification { buildFile << """ xcodebuild { signing { - certificate = project.provisioningFile1("$certificate") + certificateURI = "$certificate.absolutePath" } } """ @@ -84,6 +84,7 @@ class KeychainCreateTaskFunctionalTest extends Specification { BuildResult result = GradleRunner.create() .withProjectDir(testProjectDir.root) .withArguments(KeychainCreateTask.TASK_NAME) + .withDebug(true) .withPluginClasspath(pluginClasspath) .build() @@ -96,7 +97,7 @@ class KeychainCreateTaskFunctionalTest extends Specification { buildFile << """ xcodebuild { signing { - certificate = project.provisioningFile1("$certificate") + certificateURI = "${certificate.toURI().toString()}" certificatePassword = "p4ssword" } } @@ -107,6 +108,7 @@ class KeychainCreateTaskFunctionalTest extends Specification { .withProjectDir(testProjectDir.root) .withArguments(KeychainCreateTask.TASK_NAME) .withPluginClasspath(pluginClasspath) + .withDebug(true) .build() then: @@ -118,7 +120,7 @@ class KeychainCreateTaskFunctionalTest extends Specification { buildFile << """ xcodebuild { signing { - certificate = project.provisioningFile1("$certificate") + certificateURI = "${certificate.toURI().toString()}" certificatePassword = "p4ssword" } } diff --git a/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy b/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy new file mode 100644 index 00000000..a753b3c4 --- /dev/null +++ b/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy @@ -0,0 +1,127 @@ +package org.openbakery.carthage + +import org.gradle.testkit.runner.BuildResult +import org.gradle.testkit.runner.GradleRunner +import org.gradle.testkit.runner.TaskOutcome +import org.junit.Rule +import org.junit.rules.TemporaryFolder +import spock.lang.Specification + +class CarthageBootStrapTaskFunctionalTest extends Specification { + @Rule + final TemporaryFolder testProjectDir = new TemporaryFolder() + + List pluginClasspath + File buildFile + GradleRunner gradleRunner + File carthageFolder + + void setup() { + buildFile = testProjectDir.newFile('build.gradle') + + buildFile << """ + plugins { + id 'org.openbakery.xcode-plugin' + } + """ + + def pluginClasspathResource = getClass().classLoader.findResource("plugin-classpath.txt") + if (pluginClasspathResource == null) { + throw new IllegalStateException("Did not find plugin classpath resource, run `testClasses` build task.") + } + + pluginClasspath = pluginClasspathResource.readLines().collect { new File(it) } + + gradleRunner = GradleRunner.create() + .withProjectDir(testProjectDir.root) + .withArguments(CarthageBootStrapTask.NAME) + .withPluginClasspath(pluginClasspath) + + carthageFolder = new File(testProjectDir.root, "Carthage") + } + + def "The task list should contain the task"() { + when: + BuildResult result = gradleRunner.build() + + then: + result.output.contains(CarthageBootStrapTask.NAME) + } + + def "The task should be skipped if no cartfile is present"() { + when: + BuildResult result = gradleRunner.build() + + then: + result.task(":" + CarthageBootStrapTask.NAME) + .outcome == TaskOutcome.SKIPPED + } + + def "The task should be executed with success if a `cartfile.resolved` file is present"() { + setup: + testProjectDir.newFile(CarthageBootStrapTask.CARTHAGE_FILE) + + when: + BuildResult result = gradleRunner.build() + + then: + result.task(":" + CarthageBootStrapTask.NAME) + .outcome == TaskOutcome.SUCCESS + } + + def "The task should resolve the defined carthage dependencies"() { + setup: + File carthageFile = testProjectDir.newFile("Cartfile") + carthageFile << """ + github "ashleymills/Reachability.swift" + """ + + File carthageResolvedFile = testProjectDir.newFile(CarthageBootStrapTask.CARTHAGE_FILE) + carthageResolvedFile << """ + github "ashleymills/Reachability.swift" "v4.1.0" + """ + + when: + BuildResult result = gradleRunner.build() + + then: + result.task(":" + CarthageBootStrapTask.NAME) + .outcome == TaskOutcome.SUCCESS + + and: "The resolved framework should be existing only for iOS (default target)" + carthageFolder.exists() + new File(carthageFolder, "Build/iOS/Reachability.framework").exists() + !new File(carthageFolder, "Build/tvOS/Reachability.framework").exists() + } + + def "The task should resolve the defined carthage dependencies depending of the configured target"() { + setup: + File carthageFile = testProjectDir.newFile("Cartfile") + carthageFile << """ + github "ashleymills/Reachability.swift" + """ + + File carthageResolvedFile = testProjectDir.newFile(CarthageBootStrapTask.CARTHAGE_FILE) + carthageResolvedFile << """ + github "ashleymills/Reachability.swift" "v4.1.0" + """ + + buildFile << """ + xcodebuild { + type = "tvOS" + } + """ + + when: + BuildResult result = gradleRunner.build() + + then: + result.task(":" + CarthageBootStrapTask.NAME) + .outcome == TaskOutcome.SUCCESS + + and: "The resolved framework should be existing only for iOS (default target)" + carthageFolder.exists() + !new File(carthageFolder, "Build/iOS/Reachability.framework").exists() + new File(carthageFolder, "Build/tvOS/Reachability.framework").exists() + } +} diff --git a/plugin/src/functionalTest/groovy/org/openbakery/signing/ProvisioningInstallTaskFunctionalTest.groovy b/plugin/src/functionalTest/groovy/org/openbakery/signing/ProvisioningInstallTaskFunctionalTest.groovy index d20157ff..16dce6f6 100644 --- a/plugin/src/functionalTest/groovy/org/openbakery/signing/ProvisioningInstallTaskFunctionalTest.groovy +++ b/plugin/src/functionalTest/groovy/org/openbakery/signing/ProvisioningInstallTaskFunctionalTest.groovy @@ -30,7 +30,9 @@ class ProvisioningInstallTaskFunctionalTest extends Specification { provisioningFile1 = findResource("test1.mobileprovision") assert provisioningFile1.exists() - def pluginClasspathResource = getClass().classLoader.findResource("plugin-classpath.txt") + def pluginClasspathResource = getClass().classLoader + .findResource("plugin-classpath.txt") + if (pluginClasspathResource == null) { throw new IllegalStateException("Did not find plugin classpath resource, run `testClasses` build task.") } @@ -70,7 +72,7 @@ class ProvisioningInstallTaskFunctionalTest extends Specification { buildFile << """ xcodebuild { signing { - mobileProvisionURI = [] + mobileProvisionList = [] } } """ diff --git a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy index bfa6e3c6..ce142110 100644 --- a/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy +++ b/plugin/src/main/groovy/org/openbakery/XcodePlugin.groovy @@ -116,7 +116,6 @@ class XcodePlugin implements Plugin { public static final String OCLINT_TASK_NAME = 'oclint' public static final String OCLINT_REPORT_TASK_NAME = 'oclintReport' public static final String CPD_TASK_NAME = 'cpd' - public static final String CARTHAGE_BOOTSTRAP_TASK_NAME = 'carthageBootstrap' public static final String CARTHAGE_UPDATE_TASK_NAME = 'carthageUpdate' public static final String CARTHAGE_CLEAN_TASK_NAME = 'carthageClean' @@ -522,7 +521,7 @@ class XcodePlugin implements Plugin { } private void configureSimulatorTasks(Project project) { - project.task(SIMULATORS_LIST_TASK_NAME, type: SimulatorsListTask, group: SIMULATORS_LIST_TASK_NAME) + project.task(SIMULATORS_LIST_TASK_NAME, type: SimulatorsListTask.class, group: SIMULATORS_LIST_TASK_NAME) project.task(SIMULATORS_CREATE_TASK_NAME, type: SimulatorsCreateTask, group: SIMULATORS_LIST_TASK_NAME) project.task(SIMULATORS_CLEAN_TASK_NAME, type: SimulatorsCleanTask, group: SIMULATORS_LIST_TASK_NAME) @@ -693,7 +692,7 @@ class XcodePlugin implements Plugin { project.task(CARTHAGE_CLEAN_TASK_NAME, type: CarthageCleanTask, group: CARTHAGE_GROUP_NAME) project.task(CARTHAGE_UPDATE_TASK_NAME, type: CarthageUpdateTask, group: CARTHAGE_GROUP_NAME) - project.tasks.create(CARTHAGE_BOOTSTRAP_TASK_NAME, CarthageBootStrapTask.class) { + project.tasks.create(CarthageBootStrapTask.NAME, CarthageBootStrapTask.class) { it.group = CARTHAGE_GROUP_NAME it.requiredXcodeVersion.set(xcodeBuildPluginExtension.version) it.commandRunnerProperty.set(commandRunner) @@ -702,7 +701,7 @@ class XcodePlugin implements Plugin { } private configureCarthageDependencies(Project project) { - CarthageBootStrapTask bootStrapTask = project.getTasks().getByName(CARTHAGE_BOOTSTRAP_TASK_NAME) + CarthageBootStrapTask bootStrapTask = project.getTasks().getByName(CarthageBootStrapTask.NAME) as CarthageBootStrapTask addDependencyToBuild(project, bootStrapTask) project.getTasks() diff --git a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy index dbb86216..94df3517 100644 --- a/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy +++ b/plugin/src/main/groovy/org/openbakery/carthage/CarthageBootStrapTask.groovy @@ -34,6 +34,8 @@ class CarthageBootStrapTask extends DefaultTask { @OutputDirectory Property outputDirectory = project.objects.property(File) + public static final String NAME = "carthageBootstrap" + final Property platform = project.objects.property(Type) final Property xcodeProperty = project.objects.property(Xcode) final Property commandRunnerProperty = project.objects.property(CommandRunner) @@ -85,15 +87,13 @@ class CarthageBootStrapTask extends DefaultTask { } } - public void setXcode(Xcode xcode) { + void setXcode(Xcode xcode) { this.xcode = xcode } @TaskAction void update() { logger.warn('Bootstrap Carthage for platform ' + carthagePlatformName) - println "getCarthageCommand : " + getCarthageCommand() - project.exec(new Action() { @Override void execute(ExecSpec execSpec) { diff --git a/plugin/src/test/groovy/org/openbakery/carthage/CarthageBootStrapTaskTest.groovy b/plugin/src/test/groovy/org/openbakery/carthage/CarthageBootStrapTaskTest.groovy deleted file mode 100644 index 8f45eeb5..00000000 --- a/plugin/src/test/groovy/org/openbakery/carthage/CarthageBootStrapTaskTest.groovy +++ /dev/null @@ -1,150 +0,0 @@ -package org.openbakery.carthage - -import org.gradle.api.Project -import org.gradle.api.provider.Provider -import org.gradle.testfixtures.ProjectBuilder -import org.junit.Rule -import org.junit.rules.ExpectedException -import org.openbakery.CommandRunner -import org.openbakery.output.ConsoleOutputAppender -import org.openbakery.xcode.Xcode -import spock.lang.Specification -import spock.lang.Unroll - -import static org.openbakery.carthage.AbstractCarthageTaskBase.* -import static org.openbakery.xcode.Type.* - -class CarthageBootStrapTaskTest extends Specification { - - CarthageBootStrapTask subject - CommandRunner commandRunner = Mock(CommandRunner) - Xcode mockXcode = Mock(Xcode) - File projectDir - File cartFile - Project project - - @Rule - public ExpectedException exception = ExpectedException.none() - - void setup() { - projectDir = File.createTempDir() - - cartFile = new File(projectDir, "Cartfile") - cartFile << 'github "Alamofire/Alamofire"' - - project = ProjectBuilder.builder() - .withProjectDir(projectDir) - .build() - - project.buildDir = new File(projectDir, 'build').absoluteFile - project.apply plugin: org.openbakery.XcodePlugin - - subject = project.getTasks().getByPath('carthageBootstrap') - assert subject != null - - subject.commandRunner = commandRunner - } - - def "The carthage bootstrap task should be present"() { - expect: - subject instanceof CarthageBootStrapTask - } - - @Unroll - def "When bootstrap is executed should only update the platform: #platform"() { - given: - commandRunner.runWithResult("which", "carthage") >> "/usr/local/bin/carthage" - project.xcodebuild.type = platform - - when: - subject.update() - - then: - 1 * commandRunner.run(_, - [CARTHAGE_USR_BIN_PATH, - ACTION_BOOTSTRAP, - ARG_PLATFORM, - carthagePlatform, - ARG_CACHE_BUILDS] - , _ - , _) >> { - args -> args[3] instanceof ConsoleOutputAppender - } - - where: - platform | carthagePlatform - tvOS | CARTHAGE_PLATFORM_TVOS - macOS | CARTHAGE_PLATFORM_MACOS - watchOS | CARTHAGE_PLATFORM_WATCHOS - iOS | CARTHAGE_PLATFORM_IOS - } - - def "The task should not be executed if the 'Cartfile` file is missing"() { - given: - commandRunner.runWithResult("which", "carthage") >> "/usr/local/bin/carthage" - project.xcodebuild.type = platform - - when: - cartFile.delete() - subject.update() - - then: - 0 * commandRunner.run(_, - getCommandRunnerArgsForPlatform(carthagePlatform), - _, - _) >> { - args -> args[3] instanceof ConsoleOutputAppender - } - - where: - platform | carthagePlatform - tvOS | CARTHAGE_PLATFORM_TVOS - macOS | CARTHAGE_PLATFORM_MACOS - watchOS | CARTHAGE_PLATFORM_WATCHOS - iOS | CARTHAGE_PLATFORM_IOS - } - - def "The subject output directory should be platform dependant"() { - when: - subject.xcode.getXcodeSelectEnvValue(_) >> new HashMap() - project.xcodebuild.type = platform - - then: - Provider outputDirectory = subject.outputDirectory - outputDirectory.isPresent() - outputDirectory.get().name == carthagePlatform - - where: - platform | carthagePlatform - tvOS | CARTHAGE_PLATFORM_TVOS - macOS | CARTHAGE_PLATFORM_MACOS - watchOS | CARTHAGE_PLATFORM_WATCHOS - iOS | CARTHAGE_PLATFORM_IOS - } - - def "The xcode selection should be applied if a xcode version is defined"() { - when: - subject.xcode.getXcodeSelectEnvValue(_) >> new HashMap() - project.xcodebuild.type = iOS - project.xcodebuild.version = version - - subject.xcode = mockXcode - subject.xcode.setVersionFromString(_) >> _ - subject.update() - - then: - 1 * mockXcode.getXcodeSelectEnvValue(version) - - where: - version | _ - "7.1.1" | _ - } - - private List getCommandRunnerArgsForPlatform(String carthagePlatform) { - return [CARTHAGE_USR_BIN_PATH, - ACTION_UPDATE, - ARG_PLATFORM, - carthagePlatform, - ARG_CACHE_BUILDS] - } -} From c372b0ea52d22e1c04e506d0190c2aed2fcba71d Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Thu, 31 May 2018 10:48:39 +0100 Subject: [PATCH 6/7] Add a FROM_CACHE functional test --- .../CarthageBootStrapTaskFunctionalTest.groovy | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy b/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy index a753b3c4..ec6a21fc 100644 --- a/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy +++ b/plugin/src/functionalTest/groovy/org/openbakery/carthage/CarthageBootStrapTaskFunctionalTest.groovy @@ -82,7 +82,8 @@ class CarthageBootStrapTaskFunctionalTest extends Specification { """ when: - BuildResult result = gradleRunner.build() + BuildResult result = gradleRunner + .build() then: result.task(":" + CarthageBootStrapTask.NAME) @@ -92,6 +93,18 @@ class CarthageBootStrapTaskFunctionalTest extends Specification { carthageFolder.exists() new File(carthageFolder, "Build/iOS/Reachability.framework").exists() !new File(carthageFolder, "Build/tvOS/Reachability.framework").exists() + + when: "Force reset and build with cache enabled" + assert carthageFolder.deleteDir() + result = gradleRunner.withArguments('--build-cache', CarthageBootStrapTask.NAME) + .build() + + then: "Should resolve the carthage dependencies from cache" + result.task(":" + CarthageBootStrapTask.NAME) + .outcome == TaskOutcome.FROM_CACHE + + new File(carthageFolder, "Build/iOS/Reachability.framework").exists() + !new File(carthageFolder, "Build/tvOS/Reachability.framework").exists() } def "The task should resolve the defined carthage dependencies depending of the configured target"() { From ac6025a9a2b84b039b7f8fa63530afef57253de9 Mon Sep 17 00:00:00 2001 From: Johann Martinache Date: Thu, 31 May 2018 10:49:14 +0100 Subject: [PATCH 7/7] No more necessary --- libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy b/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy index 86be35ff..b52aeeff 100644 --- a/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy +++ b/libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy @@ -23,7 +23,7 @@ import org.openbakery.output.OutputAppender import org.slf4j.Logger import org.slf4j.LoggerFactory -class CommandRunner implements Serializable{ +class CommandRunner { private static Logger logger = LoggerFactory.getLogger(CommandRunner.class)