Skip to content

Commit

Permalink
Merge pull request #86 from SCENEE/modify-upload-bitcode-default
Browse files Browse the repository at this point in the history
Modify the default of ExportOptions.UploadBitcode
  • Loading branch information
scenee authored Nov 14, 2018
2 parents 1388adc + 8fba8b2 commit 55cad3b
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 66 deletions.
35 changes: 27 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
matrix:
language: swift
os: osx
git:
depth: 1
cache:
directories:
- /usr/local/Homebrew
- $HOME/Library/Caches/Homebrew

jobs:
include:
- os: osx
- stage: Test go packages
language: go
before_install: brew update
install: brew list --versions go | grep "1\.11.*" || brew upgrade go@1.11
script: make test-go

- stage: Test relax commands
osx_image: xcode8
- os: osx
script: test/travis_ci.sh

- stage: Test relax commands
osx_image: xcode8.3
- os: osx
script: test/travis_ci.sh

- stage: Test relax commands
osx_image: xcode9.4
- os: osx
osx_image: xcode10
script: test/travis_ci.sh

script:
- test/travis_ci.sh
- stage: Test relax commands
osx_image: xcode10
script: test/travis_ci.sh

env:
global:
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.PHONY: test
test: bats
@PATH="/bin:$$PWD/bats/bin:$$PWD/bin:$$PATH" test/run.sh ${keychain}
@PATH="$$PWD/bats/bin:$$PWD/bin:$$PATH" test/run.sh

.PHONY: test-go
test-go:
@PATH="$$PWD/bin:$$PATH" test/go.sh

version:
@PATH="$$PWD/bin:$$PATH" relax --version
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NOTE:

You need to create a provisioning profile for your identity(certificate) and install them to a build machine by yourself because Relax doesn't access to Apple Developer Center for security reasons.

But **`relax profile add` and `relax keychain add` help you to install them and resolve permissions for your identities in your keychain. I highly recommend to use those commands**. See [here](https://github.com/SCENEE/relax/blob/master/test/run.sh#L31) and [here](https://github.com/SCENEE/relax/blob/master/test/run.sh#L43).
But **`relax profile add` and `relax keychain add` help you to install them and resolve permissions for your identities in your keychain. I highly recommend to use those commands**. See [here](https://github.com/SCENEE/relax/blob/master/test/setup.sh#L22) and [here](https://github.com/SCENEE/relax/blob/master/test/setup.sh#L33).

# Installation

Expand Down
Binary file modified go/bin/relparser
Binary file not shown.
5 changes: 5 additions & 0 deletions go/src/relparser/relfile/distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ func TestCheck(t *testing.T) {
//infopath := "../../../../sample/SampleApp/Info.plist"
//d.Check(infopath)
d.Check()

if !d.ExportOptions.CompileBitcode && !d.ExportOptions.UploadBitcode {
} else {
t.Fatal("Invalid ExportOptions.UploadBitcode default")
}
}
3 changes: 3 additions & 0 deletions go/src/relparser/relfile/export_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func (opts *ExportOptions) UnmarshalYAML(unmarshal func(interface{}) error) (err
}

*opts = ExportOptions(*t)
if opts.CompileBitcode == false {
opts.UploadBitcode = false
}
return nil
}

Expand Down
17 changes: 17 additions & 0 deletions test/go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -eu

trap "relax keychain reset" EXIT

test/setup.sh

echo "Run go tests"

>/dev/null pushd go
export GOPATH="$PWD"
go get ./src/relparser/relfile/...
go test -v ./src/relparser/relfile/...
go get ./src/lspp/...
go test -v ./src/lspp/...
>/dev/null popd

test/teardown.sh
2 changes: 1 addition & 1 deletion test/relparser.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source libexec/util-build

[ "$(/usr/libexec/PlistBuddy -c "Print :teamID" $TMPDIR/options.plist)" == "J3D7L9FHSS" ] \
&& [ "$(/usr/libexec/PlistBuddy -c "Print :compileBitcode" $TMPDIR/options.plist)" == "false" ] \
&& [ "$(/usr/libexec/PlistBuddy -c "Print :uploadBitcode" $TMPDIR/options.plist)" == "true" ]
&& [ "$(/usr/libexec/PlistBuddy -c "Print :uploadBitcode" $TMPDIR/options.plist)" == "false" ]
}

@test "relparser plist" {
Expand Down
57 changes: 2 additions & 55 deletions test/run.sh
Original file line number Diff line number Diff line change
@@ -1,67 +1,14 @@
#!/bin/bash -eu

if [[ $# = 0 ]]; then
keychain=relax.keychain
else
keychain=$keychain
if ! grep -q "\.keychain" <<< "$keychain"; then
echo "Error: invalid keychain name($1)"
echo " Please add '.keychain' extension."
exit 1
fi
fi

if [[ -f PRIVATE ]]; then
source PRIVATE # Defined 'CERTS_PASS' values
fi

if [[ ${DECORD_KEY:-none} = "none" || ${CERTS_PASS:-none} = "none" ]]; then
echo "Error: DECORD_KEY or CERTS_PASS are not defined."
exit 1
fi

############################
# Set up a custom keychain #
############################

relax keychain create $keychain -p relax

relax dec -p "$DECORD_KEY" sample/certificates/RelaxCertificates.p12.enc

relax keychain add sample/certificates/RelaxCertificates.p12 -P "$CERTS_PASS" -k $keychain -p relax

trap "relax keychain reset" EXIT
relax keychain use $keychain -p relax

#################################
# Install Provisioning Profiles #
#################################

relax dec -p "$DECORD_KEY" sample/certificates/Relax_Development.mobileprovision.enc
relax dec -p "$DECORD_KEY" sample/certificates/Relax_AdHoc.mobileprovision.enc

relax profile add sample/certificates/Relax_Development.mobileprovision
relax profile add sample/certificates/Relax_AdHoc.mobileprovision
test/setup.sh

############
# Run Test #
############

export NOCOLOR=true

bats test

#############
# Tear down #
#############

relax profile rm "Relax Development"
relax profile rm "Relax AdHoc"

# Test `relax keychain rm`
while IFS= read -r identity && [[ -n "$identity" ]]
do
relax keychain rm "$(echo "$identity" | awk '{ print $1 }')" -k $keychain -p relax
done < <(relax keychain info sample/certificates/RelaxCertificates.p12 -P "$CERTS_PASS")

relax keychain delete $keychain
test/teardown.sh
35 changes: 35 additions & 0 deletions test/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -eu

KEYCHAIN=relax.keychain

if [[ -f PRIVATE ]]; then
source PRIVATE # Defined 'CERTS_PASS' values
fi

if [[ ${DECORD_KEY:-none} = "none" || ${CERTS_PASS:-none} = "none" ]]; then
echo "Error: DECORD_KEY or CERTS_PASS are not defined."
exit 1
fi

############################
# Set up a custom keychain #
############################

relax KEYCHAIN create $KEYCHAIN -p relax

relax dec -p "$DECORD_KEY" sample/certificates/RelaxCertificates.p12.enc

relax KEYCHAIN add sample/certificates/RelaxCertificates.p12 -P "$CERTS_PASS" -k $KEYCHAIN -p relax

relax KEYCHAIN use $KEYCHAIN -p relax

#################################
# Install Provisioning Profiles #
#################################

relax dec -p "$DECORD_KEY" sample/certificates/Relax_Development.mobileprovision.enc
relax dec -p "$DECORD_KEY" sample/certificates/Relax_AdHoc.mobileprovision.enc

relax profile add sample/certificates/Relax_Development.mobileprovision
relax profile add sample/certificates/Relax_AdHoc.mobileprovision

22 changes: 22 additions & 0 deletions test/teardown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -eu

#############
# Tear down #
#############

KEYCHAIN=relax.keychain

if [[ -f PRIVATE ]]; then
source PRIVATE # Defined 'CERTS_PASS' values
fi

relax profile rm "Relax Development"
relax profile rm "Relax AdHoc"

# Test `relax keychain rm`
while IFS= read -r identity && [[ -n "$identity" ]]
do
relax keychain rm "$(echo "$identity" | awk '{ print $1 }')" -k $KEYCHAIN -p relax
done < <(relax keychain info sample/certificates/RelaxCertificates.p12 -P "$CERTS_PASS")

relax keychain delete $KEYCHAIN

0 comments on commit 55cad3b

Please sign in to comment.