SynchroLabs / SynchroServer

The Synchro Server platform
https://synchro.io
1 stars 2 forks source link

Build automation #30

Open bcr opened 9 years ago

bcr commented 9 years ago

Trying to come up with a plan for build automation. I think at least on OS X I can do:

xbuild /target:MaaasClientIOS /property:Configuration=Debug /property:Platform=iPhoneSimulator
xbuild /target:MaaasClientAndroid /property:Configuration=Debug

From the MaaasClient directory which I think builds the iOS and Android versions.

There are probably msbuild equivalent command lines for the Windows / Windows Phone versions. I don't think we can build all platforms on one build platform is the problem. There may be a way to configure remote building of iOS from Windows, but we will still need an iOS and a Windows dev platform available.

bcr commented 9 years ago

Latest exploration on OS X I can do:

xcodebuild -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

For SynchroSwift, and:

./gradlew assembleRelease

For SynchroClientAndroid.

bcr commented 9 years ago

For unit tests I can do (will run simulator if not running)

xcodebuild test -scheme SynchroSwift -destination 'platform=iOS Simulator,name=iPhone 6'

To build and run unit tests on Android, with the emulator already running, use:

./gradlew connectedAndroidTest

bcr commented 9 years ago

For Windows / Windows Phone I was able to:

msbuild SynchroClientWin.WindowsPhone\SynchroClientWin.WindowsPhone.csproj /p:AppxPackageSigningEnabled=false
msbuild SynchroClientWin\SynchroClientWin.csproj /p:AppxPackageSigningEnabled=false

This article was useful. http://blogs.msdn.com/b/dsvc/archive/2014/02/17/using-msbuild-to-build-windows-store-application-without-signing-the-appxpackage.aspx

To select Debug / Release builds, we may need to use /property:Configuration=Debug|Release as required (pick one of "Debug" or "Release").

bcr commented 9 years ago

Not sure where to put this yet, this is the way I created the keystore for the Android app:

Blakes-MBP:Synchro blake$ keytool -genkey -v -keystore io.synchro.client.android.keystore -alias app -keyalg RSA -keysize 2048 -validity 10000
Enter keystore password:  
Re-enter new password: 
What is your first and last name?
  [Unknown]:  Synchro Explorer
What is the name of your organizational unit?
  [Unknown]:  
What is the name of your organization?
  [Unknown]:  Synchro Labs, Inc.
What is the name of your City or Locality?
  [Unknown]:  Redmond
What is the name of your State or Province?
  [Unknown]:  WA
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=Synchro Explorer, OU=Unknown, O="Synchro Labs, Inc.", L=Redmond, ST=WA, C=US correct?
  [no]:  yes

Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
    for: CN=Synchro Explorer, OU=Unknown, O="Synchro Labs, Inc.", L=Redmond, ST=WA, C=US
Enter key password for <app>
    (RETURN if same as keystore password):  
[Storing io.synchro.client.android.keystore]
bcr commented 9 years ago

Commands for signing apk:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../../io.synchro.client.android.keystore app/build/outputs/apk/app-release-unsigned.apk app
~/Library/Developer/Xamarin/android-sdk-macosx/build-tools/21.0.1/zipalign -v 4 app/build/outputs/apk/app-release-unsigned.apk app/build/outputs/apk/app-release.apk