Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2f6d65b
--wip-- [skip ci]
deltatre-johann Jun 4, 2018
07f9a82
--wip-- [skip ci]
deltatre-johann Jun 4, 2018
426d56a
Tweak versioning
deltatre-johann Jun 4, 2018
92d5a95
Add reckon back
deltatre-johann Jun 5, 2018
1b4f70c
Add SNAPSHOT suffix
deltatre-johann Jun 5, 2018
42bb84e
Temp fix
deltatre-johann Jun 5, 2018
1dd6bff
Make the packaging xcode version dependant too
deltatre-johann Jun 5, 2018
bc11e17
Cleanup
deltatre-johann Jun 5, 2018
587039a
Switch versioning to nebula.release more simple and reliable
deltatre-johann Jun 5, 2018
9f1c6d8
--wip-- [skip ci]
deltatre-johann Jun 5, 2018
207a9ba
--wip-- [skip ci]
deltatre-johann Jun 5, 2018
7cc15dc
Simplify versioning via git describe
deltatre-johann Jun 6, 2018
4fab1e1
Remove the no more present property
deltatre-johann Jun 6, 2018
7831b6b
No more necessary
deltatre-johann Jun 6, 2018
115cbcd
Fix the missing version setter
deltatre-johann Jun 6, 2018
1ad8c3c
Merge branch 'feature/arch-sign-adjust' of github.com:massiveinteract…
deltatre-johann Jun 6, 2018
f142197
--wip-- [skip ci]
deltatre-johann Jun 6, 2018
76cfe3c
Cleanup
deltatre-johann Jun 6, 2018
228dc25
Test
deltatre-johann Jun 6, 2018
fb4e096
Revert unwanted changes
deltatre-johann Jun 6, 2018
aa6d96e
Filter provisioning profiles by target type
deltatre-johann Jun 8, 2018
226139a
--wip-- [skip ci]
deltatre-johann Jun 12, 2018
0c25ed2
- Refactoring the executaiton of XcodeBuildArchiveTaskIosAndTvOS.groo…
deltatre-johann Jun 13, 2018
37beff4
Make it verbose for now
deltatre-johann Jun 13, 2018
c7fc4e6
Specify the working dir
deltatre-johann Jun 13, 2018
7d037a6
- Replace exec with ProcessBuilder
deltatre-johann Jun 14, 2018
21b98a9
- Fix the buid type property to use the proper lazy value
deltatre-johann Jun 14, 2018
8bcd035
- Describe the build folder for the archiving task
deltatre-johann Jun 14, 2018
4e768f1
- Remove the local resolution of the signature friendly name
deltatre-johann Jun 14, 2018
d8dbef9
- Create a FunctionalTestBase base class to simplify boilerplate for …
deltatre-johann Jun 19, 2018
dd0033e
Now allow to change the bundle identifier of the targert
deltatre-johann Jul 19, 2018
e773d18
Add more traces for clarity
deltatre-johann Jul 19, 2018
c4421cc
Disable the onlyIf check for now
deltatre-johann Jul 19, 2018
8da7983
Add task dependency
deltatre-johann Jul 19, 2018
e809070
Allow to customise the version and shortversion for all the build con…
deltatre-johann Jul 20, 2018
60e735e
Do not set a null value into the plist file
deltatre-johann Feb 19, 2019
c25cc83
feature : Add workspace support
deltatre-johann Jan 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
allprojects {
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'
String getGitDescribeVersion() {
ByteArrayOutputStream output = new ByteArrayOutputStream()

def versionNumber = "0.16.0.a603076-SNAPSHOT"
project.exec({ ExecSpec execSpec ->
execSpec.args = ["describe", "--tags", "--always", "--first-parent"]
execSpec.executable = "git"
execSpec.standardOutput = output
})

if (project.hasProperty("versionNumber")) {
versionNumber = project.versionNumber
}
if (project.hasProperty("versionSuffix")) {
versionNumber += project.versionSuffix
}
if (project.hasProperty("buildNumber")) {
versionNumber += "." + project.buildNumber
}
return output.toString().trim()
}

//
allprojects {
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'

group = 'org.openbakery'
version = versionNumber
version = getGitDescribeVersion() + "-SNAPSHOT"

sourceCompatibility = "1.6"
targetCompatibility = "1.6"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
Expand Down
4 changes: 3 additions & 1 deletion example/OSX/ExampleOSX/ExampleOSX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
TargetAttributes = {
A7F1890E1A6FE161002D206F = {
CreatedOnToolsVersion = 6.1.1;
DevelopmentTeam = Z7L2YCUH45;
DevelopmentTeam = 2YFT3F89TY;
};
A7F189211A6FE161002D206F = {
CreatedOnToolsVersion = 6.1.1;
Expand Down Expand Up @@ -404,6 +404,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 2YFT3F89TY;
INFOPLIST_FILE = ExampleOSX/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -417,6 +418,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 2YFT3F89TY;
INFOPLIST_FILE = ExampleOSX/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
6 changes: 1 addition & 5 deletions libxcode/src/main/groovy/org/openbakery/CommandRunner.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -34,10 +34,6 @@ class CommandRunner {

Thread readerThread

public CommandRunner() {

}

void setOutputFile(File outputFile) {
if (outputFile.exists()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ class ProvisioningProfileReader {
}
}

List<String> getPlatforms() {
return config.getProperty("Platform")
}

String getUUID() {
return config.getString("UUID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ class PlistHelper {


void setValueForPlist(File plist, String key, String value) {
commandForPlist(plist, "Set :" + key + " " + value)
if (value != null)
commandForPlist(plist, "Set :" + key + " " + value)
}


void commandForPlist(File plist, String command) {
if (!plist.exists()) {
throw new IllegalStateException("Info Plist does not exist: " + plist.absolutePath);
Expand Down
30 changes: 20 additions & 10 deletions libxcode/src/main/groovy/org/openbakery/xcode/Xcodebuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Xcodebuild {
public static final String EXECUTABLE = "xcodebuild"
public static final String ACTION_ARCHIVE = "archive"
public static final String ACTION_EXPORT_ARCHIVE = "-exportArchive"
public static final String ARGUMENT_CONFIGURATION = "-configuration"
public static final String ARGUMENT_WORKSPACE = "-workspace"
public static final String ARGUMENT_SCHEME = "-scheme"
public static final String ARGUMENT_ARCHIVE_PATH = "-archivePath"
public static final String ARGUMENT_EXPORT_PATH = "-exportPath"
Expand Down Expand Up @@ -50,26 +52,34 @@ class Xcodebuild {
static void packageIpa(CommandRunner commandRunner,
File archivePath,
File exportPath,
File exportOptionsPlist) {
File exportOptionsPlist,
@Nullable File xcodeApp) {

assert archivePath != null && archivePath.exists()
assert exportPath != null && exportPath.exists()
assert exportOptionsPlist != null && exportOptionsPlist.exists()

commandRunner.run(EXECUTABLE,
ACTION_EXPORT_ARCHIVE,
ARGUMENT_ARCHIVE_PATH, archivePath.absolutePath,
ARGUMENT_EXPORT_PATH, exportPath.absolutePath,
ARGUMENT_EXPORT_OPTIONS_PLIST, exportOptionsPlist.absolutePath)
// Env value
HashMap<String, String> envMap = new HashMap<>()
if (xcodeApp != null) {
envMap.put(Xcode.ENV_DEVELOPER_DIR, xcodeApp.absolutePath)
}

List<String> args = [EXECUTABLE,
ACTION_EXPORT_ARCHIVE,
ARGUMENT_ARCHIVE_PATH, archivePath.absolutePath,
ARGUMENT_EXPORT_PATH, exportPath.absolutePath,
ARGUMENT_EXPORT_OPTIONS_PLIST, exportOptionsPlist.absolutePath]

commandRunner.run(args, envMap)
}

static void archive(CommandRunner commandRunner,
String scheme,
File outputPath,
File xcConfig,
String configuration,
@Nullable File xcodeApp) {
assert scheme != null
assert xcConfig.exists() && !xcConfig.isDirectory()

HashMap<String, String> envMap = new HashMap<>()

Expand All @@ -80,8 +90,8 @@ class Xcodebuild {
List<String> args = [EXECUTABLE,
ACTION_ARCHIVE,
ARGUMENT_SCHEME, scheme,
ARGUMENT_ARCHIVE_PATH, outputPath.absolutePath,
ARGUMENT_XCCONFIG, xcConfig.absolutePath]
"-configuration", configuration,
ARGUMENT_ARCHIVE_PATH, outputPath.absolutePath]

commandRunner.run(args, envMap)
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ uploadArchives {
mavenDeployer {
configuration = configurations.deployerJars

repository(url: publishURL) {
repository(url: mavenLocal().url) {
authentication(userName: publishUser, password: publishPassword)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.openbakery

import org.apache.commons.io.FileUtils
import org.junit.Rule
import org.junit.rules.TemporaryFolder
import spock.lang.Specification

class FunctionalTestBase extends Specification {

@Rule
final TemporaryFolder testProjectDir = new TemporaryFolder()

List<File> pluginClasspath

File buildFile

void genericSetup() {
extractPluginClassPathResource()
createMockBuildFile()
copyTestProject()
}

void extractPluginClassPathResource() {
URL 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) }
}

void createMockBuildFile() {
buildFile = testProjectDir.newFile('build.gradle')
buildFile << """
plugins {
id 'org.openbakery.xcode-plugin'
}
"""
}

void copyTestProject() {
URL folder = getClass().classLoader
.findResource("TestProject")


File file = new File(folder.getFile())
assert file.exists()

FileUtils.copyDirectory(file, testProjectDir.root)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,23 @@ package org.openbakery
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 org.openbakery.signing.KeychainCreateTask
import spock.lang.Shared
import spock.lang.Specification

import java.nio.file.Paths

class KeychainCreateTaskFunctionalTest extends Specification {

@Rule
final TemporaryFolder testProjectDir = new TemporaryFolder()

List<File> pluginClasspath
class KeychainCreateTaskFunctionalTest extends FunctionalTestBase {

@Shared
File certificate

File buildFile

def setup() {
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) }
extractPluginClassPathResource()
createMockBuildFile()
copyTestProject()

certificate = findResource("fake_distribution.p12")
assert certificate.exists()

buildFile = testProjectDir.newFile('build.gradle')
buildFile << """
plugins {
id 'org.openbakery.xcode-plugin'
}
"""
}

def "The task list should contain the task"() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,15 @@
package org.openbakery

import org.gradle.testkit.runner.GradleRunner
import org.junit.Rule
import org.junit.rules.TemporaryFolder
import org.openbakery.packaging.PackageTaskIosAndTvOS
import spock.lang.Specification

class PackageTaskIosAndTvOSTest extends Specification {

@Rule
final TemporaryFolder testProjectDir = new TemporaryFolder()

List<File> pluginClasspath

File buildFile
class PackageTaskIosAndTvOSTest extends FunctionalTestBase {

def setup() {
buildFile = testProjectDir.newFile('build.gradle')

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) }
genericSetup()
}

def "The task list should contain the task"() {
given:
buildFile << """
plugins {
id 'org.openbakery.xcode-plugin'
}
"""

when:
def result = GradleRunner.create()
.withProjectDir(testProjectDir.root)
Expand Down
Loading