Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to build in VSTS #2362

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ else
endif
endif

package:
mkdir -p ../package
$(MAKE) -C ../maccore package
# copy .pkg, .zip and *updateinfo to the packages directory to be uploaded to storage
cp ../maccore/release/*.pkg ../package
-cp ../maccore/release/*.zip ../package
-cp ../maccore/release/*updateinfo ../package
-cp ../maccore/tests/*.zip ../package
-cp ../xamarin-macios/tests/*.zip ../package

install-system: install-system-ios install-system-mac
@# Clean up some old files
$(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS
Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo "PATH ======= $PATH"
echo "WORKSPACE ======= $WORKSPACE"
cd .. && mv s xamarin-macios && cd xamarin-macios
make $1
cd .. && mv xamarin-macios s && cd s

63 changes: 63 additions & 0 deletions product-sign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash -ex
#
# productsign.sh: run productsign against any installer .pkg
# files in the package output directory for the lane, signing
# with the Xamarin Developer Installer identity and verifying
# the signature's fingerprint after the fact.
#
# Author:
# Aaron Bockover <abock@xamarin.com>
#
# Copyright 2014 Xamarin, Inc.
#

PRODUCTSIGN_KEYCHAIN="login.keychain"
PRODUCTSIGN_KEYCHAIN_PASSWORD="beefydude"
PRODUCTSIGN_IDENTITY="Developer ID Installer: Xamarin Inc"
PRODUCTSIGN_FINGERPRINT="3F:BE:54:B1:41:8B:F1:20:FA:B4:9D:A7:F2:5E:72:95:5A:49:21:D6"

if [ -z "$BUILD_REVISION" ]; then
echo BUILD_REVISION is unset. Using BUILD_SOURCEVERSION.
BUILD_REVISION=$BUILD_SOURCEVERSION
fi

if [ -z "$BUILD_SOURCEVERSION" ]; then
echo BUILD_SOURCEVERSION is unset. Bailing.
exit 1
fi

mkdir -p "/tmp/$BUILD_REVISION"

echo Before signing
ls -l ../package

security -v find-identity
security unlock-keychain -p "$PRODUCTSIGN_KEYCHAIN_PASSWORD" "$PRODUCTSIGN_KEYCHAIN"

for pkg in ../package/*.pkg; do
productsign -s "$PRODUCTSIGN_IDENTITY" "$pkg" "/tmp/$BUILD_REVISION/$(basename "$pkg")"
done

echo Signing output
ls -l /tmp/$BUILD_REVISION

mv /tmp/$BUILD_REVISION/* ../package

echo After signing
ls -l ../package

echo 'setns x=http://www.w3.org/2000/09/xmldsig#' > shell.xmllint
echo 'cat (//xar/toc/signature/x:KeyInfo/x:X509Data/x:X509Certificate)[1]/text()' >> shell.xmllint

echo Signature Verification
for pkg in ../package/*.pkg; do
pkgutil --check-signature "$pkg"
xar -f "$pkg" --dump-toc="$pkg.toc"
(
echo '-----BEGIN CERTIFICATE-----' &&
xmllint --shell "$pkg.toc" < shell.xmllint | grep -Ev '^/' &&
echo '-----END CERTIFICATE-----'
) | openssl x509 -fingerprint | grep "$PRODUCTSIGN_FINGERPRINT" || exit 1
done

rm shell.xmllint
33 changes: 19 additions & 14 deletions system-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ set -o pipefail

FAIL=
PROVISION_DOWNLOAD_DIR=/tmp/x-provisioning

SUDO=sudo
# parse command-line arguments
while ! test -z $1; do
case $1 in
--no-sudo)
SUDO=
shift
;;
--provision-xcode)
PROVISION_XCODE=1
shift
Expand Down Expand Up @@ -159,7 +163,7 @@ function install_mono () {
curl -L $MONO_URL > $MONO_PKG

log "Installing Mono $MIN_MONO_VERSION from $MONO_URL..."
sudo installer -pkg $MONO_PKG -target /
$SUDO installer -pkg $MONO_PKG -target /

rm -f $MONO_PKG
}
Expand All @@ -184,9 +188,9 @@ function install_visual_studio () {
log "Mounting $VS_DMG into $VS_MOUNTPOINT..."
hdiutil attach $VS_DMG -mountpoint $VS_MOUNTPOINT -quiet -nobrowse
log "Removing previous Visual Studio from $VS"
sudo rm -Rf "$VS"
$SUDO rm -Rf "$VS"
log "Installing Visual Studio $MIN_VISUAL_STUDIO_VERSION to $VS..."
sudo cp -R "$VS_MOUNTPOINT/Visual Studio.app" /Applications
$SUDO cp -R "$VS_MOUNTPOINT/Visual Studio.app" /Applications
log "Unmounting $VS_DMG..."
hdiutil detach $VS_MOUNTPOINT -quiet

Expand Down Expand Up @@ -247,28 +251,28 @@ function install_specific_xcode () {
rm -f $XCODE_DMG

log "Removing any com.apple.quarantine attributes from the installed Xcode"
sudo xattr -d -r com.apple.quarantine $XCODE_ROOT
$SUDO xattr -d -r com.apple.quarantine $XCODE_ROOT

if is_at_least_version $XCODE_VERSION 5.0; then
log "Accepting Xcode license"
sudo $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild -license accept
$SUDO $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild -license accept
fi

if is_at_least_version $XCODE_VERSION 8.0; then
PKGS="MobileDevice.pkg MobileDeviceDevelopment.pkg XcodeSystemResources.pkg"
for pkg in $PKGS; do
if test -f "$XCODE_DEVELOPER_ROOT/../Resources/Packages/$pkg"; then
log "Installing $pkg"
sudo /usr/sbin/installer -dumplog -verbose -pkg "$XCODE_DEVELOPER_ROOT/../Resources/Packages/$pkg" -target /
$SUDO /usr/sbin/installer -dumplog -verbose -pkg "$XCODE_DEVELOPER_ROOT/../Resources/Packages/$pkg" -target /
log "Installed $pkg"
else
log "Not installing $pkg because it doesn't exist."
fi
done
fi

log "Executing 'sudo xcode-select -s $XCODE_DEVELOPER_ROOT'"
sudo xcode-select -s $XCODE_DEVELOPER_ROOT
log "Executing '$SUDO xcode-select -s $XCODE_DEVELOPER_ROOT'"
$SUDO xcode-select -s $XCODE_DEVELOPER_ROOT

ok "Xcode $XCODE_VERSION provisioned"
}
Expand All @@ -295,9 +299,9 @@ function check_specific_xcode () {
if is_at_least_version $XCODE_VERSION 5.0; then
if ! $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild -license check >/dev/null 2>&1; then
if ! test -z $PROVISION_XCODE; then
sudo $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild -license accept
$SUDO $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild -license accept
else
fail "The license for Xcode $XCODE_VERSION has not been accepted. Execute 'sudo $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild' to review the license and accept it."
fail "The license for Xcode $XCODE_VERSION has not been accepted. Execute '$SUDO $XCODE_DEVELOPER_ROOT/usr/bin/xcodebuild' to review the license and accept it."
fi
return
fi
Expand All @@ -314,10 +318,10 @@ function check_specific_xcode () {
local XCODE_SELECT=$(xcode-select -p)
if [[ "x$XCODE_SELECT" != "x$XCODE_DEVELOPER_ROOT" ]]; then
if ! test -z $PROVISION_XCODE; then
log "Executing 'sudo xcode-select -s $XCODE_DEVELOPER_ROOT'"
sudo xcode-select -s $XCODE_DEVELOPER_ROOT
log "Executing '$SUDO xcode-select -s $XCODE_DEVELOPER_ROOT'"
$SUDO xcode-select -s $XCODE_DEVELOPER_ROOT
else
fail "'xcode-select -p' does not point to $XCODE_DEVELOPER_ROOT, it points to $XCODE_SELECT. Execute 'sudo xcode-select -s $XCODE_DEVELOPER_ROOT' to fix."
fail "'xcode-select -p' does not point to $XCODE_DEVELOPER_ROOT, it points to $XCODE_SELECT. Execute '$SUDO xcode-select -s $XCODE_DEVELOPER_ROOT' to fix."
fi
fi

Expand Down Expand Up @@ -596,3 +600,4 @@ else
echo "System check failed"
exit 1
fi