refactor build scripts

This commit is contained in:
Matias Alejo Garcia 2016-08-10 17:35:40 -03:00
commit 23f7f56f3f
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
110 changed files with 512 additions and 954 deletions

View file

@ -1,50 +0,0 @@
.PHONY: plugins android wp8 ios clean
all:
# grunt dist-mobile-dbg
plugins:
make -C project plugins
project:
cordova create project com.bitpay.copay Copay
cp config.xml project/config.xml
cp ProjectMakefile project/Makefile
cp -af ../dist/web/** project/www
sed "s/<\!-- PLACEHOLDER: CORDOVA SRIPT -->/<script type='text\/javascript' charset='utf-8' src='cordova.js'><\/script>/g" ../index.html > project/www/index.html
android: project plugins
mkdir -p project/platforms/android/res/xml/
cp android/AndroidManifest.xml project/platforms/android/AndroidManifest.xml
cp android/project.properties project/platforms/android/project.properties
cp -R android/res/* project/platforms/android/res
make -C project android
wp8: project plugins
make -C project wp8
cp -R project/www/* project/platforms/wp8/www
cp -R wp/res/* project/platforms/wp/res
ios: project plugins
make -C project ios
cp ios/Copay-Info.plist project/platforms/ios/Copay-Info.plist
mkdir -p project/platforms/ios/Copay/Resources/icons
mkdir -p project/platforms/ios/Copay/Resources/splash
cp -R ios/icons/* project/platforms/ios/Copay/Resources/icons
cp -R ios/splash/* project/platforms/ios/Copay/Resources/splash
open-ios: ios
open project/platforms/ios/Copay.xcodeproj
run-android: android
make -C project run-android
release-android: android
make -C project release-android
clean:
rm -rf project

View file

@ -1,31 +0,0 @@
.PHONY: android plugins wp8 ios
plugins:
@echo "Intalling cordova plugins"
cordova plugin add https://github.com/Initsogar/cordova-webintent.git
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
cordova plugin add org.apache.cordova.splashscreen
cordova plugin add org.apache.cordova.statusbar
cordova plugin add https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git --variable URL_SCHEME=bitcoin
cordova plugin add org.apache.cordova.inappbrowser
android:
cordova platforms add android
wp8:
cordova platforms add wp8
ios:
cordova platforms add ios
build-ios:
cordova build ios
run-android:
cordova run android
release-android:
cordova build android --release

View file

@ -1,36 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="v0.10.7" android:windowSoftInputMode="adjustPan" package="com.bitpay.copay" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="@drawable/copay" android:label="@string/app_name" android:allowBackup="false">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:clearTaskOnLaunch="true" android:configChanges="orientation|screenSize|keyboardHidden" android:exported="false" android:name="com.google.zxing.client.android.CaptureActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="@string/share_name" android:name="com.google.zxing.client.android.encode.EncodeActivity">
<intent-filter>
<action android:name="com.phonegap.plugins.barcodescanner.ENCODE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:label="@string/share_name" android:name="com.google.zxing.client.android.HelpActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
</manifest>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,240 +0,0 @@
#! /bin/bash
#
# Usage:
# sh ./build.sh --android --reload
#
#
# Check function OK
checkOK() {
if [ $? != 0 ]; then
echo "${OpenColor}${Red}* ERROR. Exiting...${CloseColor}"
exit 1
fi
}
# Configs
BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT="$BUILDDIR/project"
CURRENT_OS=$1
if [ -z "CURRENT_OS" ]
then
echo "Build.sh WP8|ANDROID|IOS"
fi
CLEAR=false
DBGJS=false
if [[ $2 == "--clear" || $3 == "--clear" ]]
then
CLEAR=true
fi
if [[ $2 == "--dbgjs" || $3 == "--dbgjs" ]]
then
DBGJS=true
fi
echo "${OpenColor}${Green}* Checking dependencies...${CloseColor}"
command -v cordova >/dev/null 2>&1 || { echo >&2 "Cordova is not present, please install it: sudo npm -g cordova."; exit 1; }
#command -v xcodebuild >/dev/null 2>&1 || { echo >&2 "XCode is not present, install it or use [--android]."; exit 1; }
# Create project dir
if $CLEAR
then
if [ -d $PROJECT ]; then
rm -rf $PROJECT
fi
fi
echo "Build directory is $BUILDDIR"
echo "Project directory is $PROJECT"
if [ ! -d $PROJECT ]; then
cd $BUILDDIR
echo "${OpenColor}${Green}* Creating project... ${CloseColor}"
cordova create project com.bitpay.copay Copay
checkOK
cd $PROJECT
if [ $CURRENT_OS == "ANDROID" ]; then
echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}"
cordova platforms add android@5.1.1
checkOK
fi
if [ $CURRENT_OS == "IOS" ]; then
echo "${OpenColor}${Green}* Adding IOS platform... ${CloseColor}"
cordova platforms add ios
checkOK
fi
if [ $CURRENT_OS == "WP8" ]; then
echo "${OpenColor}${Green}* Adding WP8 platform... ${CloseColor}"
cordova platforms add wp8
checkOK
fi
echo "${OpenColor}${Green}* Installing plugins... ${CloseColor}"
if [ $CURRENT_OS == "IOS" ]
then
cordova plugin add https://github.com/tjwoon/csZBar.git
checkOK
else
cordova plugin add https://github.com/jrontend/phonegap-plugin-barcodescanner
checkOK
fi
if [ $CURRENT_OS == "IOS" ]; then
cordova plugin add phonegap-plugin-push@1.5.3
checkOK
fi
if [ $CURRENT_OS == "ANDROID" ]; then
cordova plugin add phonegap-plugin-push@1.2.3
checkOK
fi
cordova plugin add cordova-plugin-globalization
checkOK
cordova plugin add cordova.plugins.diagnostic
checkOK
cordova plugin add cordova-plugin-splashscreen
checkOK
cordova plugin add cordova-plugin-statusbar
checkOK
cordova plugin add https://github.com/cmgustavo/Custom-URL-scheme.git --variable URL_SCHEME=bitcoin --variable SECOND_URL_SCHEME=copay
checkOK
cordova plugin add cordova-plugin-inappbrowser
checkOK
cordova plugin add cordova-plugin-x-toast && cordova prepare
checkOK
cordova plugin add https://github.com/VersoSolutions/CordovaClipboard
checkOK
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git && cordova prepare
checkOK
cordova plugin add cordova-plugin-spinner-dialog
checkOK
cordova plugin add cordova-plugin-dialogs
checkOK
cordova plugin add cordova-plugin-network-information
checkOK
cordova plugin add cordova-plugin-console
checkOK
cordova plugin add cordova-plugin-uniquedeviceid
checkOK
cordova plugin add cordova-plugin-file
checkOK
cordova plugin add cordova-plugin-touch-id && cordova prepare
checkOK
cordova plugin add cordova-plugin-transport-security
checkOK
cordova plugin add cordova-ios-requires-fullscreen
checkOK
cordova plugin add cordova-plugin-disable-bitcode
checkOK
## Fix plugin android-fingerprint
rm -rf $PROJECT/platforms/android/res/values-es
cordova plugin add cordova-plugin-android-fingerprint-auth
checkOK
cordova plugin add cordova-plugin-screen-orientation
checkOK
cordova plugin add ionic-plugin-keyboard
checkOK
fi
if $DBGJS
then
echo "${OpenColor}${Green}* Generating copay bundle (debug js)...${CloseColor}"
cd $BUILDDIR/..
grunt
checkOK
else
echo "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
cd $BUILDDIR/..
grunt prod
checkOK
fi
echo "${OpenColor}${Green}* Copying files...${CloseColor}"
cd $BUILDDIR/..
cp -af public/** $PROJECT/www
checkOK
sed "s/<\!-- PLACEHOLDER: CORDOVA SRIPT -->/<script type='text\/javascript' charset='utf-8' src='cordova.js'><\/script>/g" public/index.html > $PROJECT/www/index.html
checkOK
cd $BUILDDIR
cp config.xml $PROJECT/config.xml
checkOK
if [ $CURRENT_OS == "ANDROID" ]; then
echo "Android project!!!"
mkdir -p $PROJECT/platforms/android/res/xml/
checkOK
# cp android/AndroidManifest.xml $PROJECT/platforms/android/AndroidManifest.xml
# checkOK
cp android/build-extras.gradle $PROJECT/platforms/android/build-extras.gradle
checkOK
cp android/project.properties $PROJECT/platforms/android/project.properties
checkOK
mkdir -p $PROJECT/scripts
checkOK
cp scripts/* $PROJECT/scripts
checkOK
cp -R android/res/* $PROJECT/platforms/android/res
checkOK
fi
if [ $CURRENT_OS == "WP8" ]; then
echo "Wp8 project!!!"
cp -R $PROJECT/www/* $PROJECT/platforms/wp8/www
checkOK
if ! $CLEAR
then
cp -vf wp/Properties/* $PROJECT/platforms/wp8/Properties/
checkOK
cp -vf wp/MainPage.xaml $PROJECT/platforms/wp8/
checkOK
cp -vf wp/Package.appxmanifest $PROJECT/platforms/wp8/
checkOK
cp -vf wp/Assets/* $PROJECT/platforms/wp8/Assets/
cp -vf wp/SplashScreenImage.jpg $PROJECT/platforms/wp8/
cp -vf wp/ApplicationIcon.png $PROJECT/platforms/wp8/
cp -vf wp/Background.png $PROJECT/platforms/wp8/
checkOK
fi
fi

View file

@ -1,75 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.bitpay.copay"
version="2.5.0"
android-versionCode="115"
ios-CFBundleVersion="2.5.0">
<name>Copay</name>
<description>
A secure bitcoin wallet for friends and companies.
</description>
<author email="support@bitpay.com" href="https://copay.io">
BitPay Inc.
</author>
<content src="index.html" />
<access origin="*" />
<preference name="AndroidPersistentFileLocation" value="Internal" />
<preference name="iosPersistentFileLocation" value="Library" />
<preference name="DisallowOverscroll" value="true"/>
<preference name="HideKeyboardFormAccessoryBar" value="true"/>
<preference name="SplashScreen" value="copayscreen" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="1" />
<preference name="BackgroundColor" value="#2C3E50" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#2C3E50" />
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="BackupWebStorage" value="none"/>
<preference name="windows-target-version" value="8.1"/>
<preference name="Orientation" value="default" />
<platform name="android">
<hook type="after_run" src="scripts/afterRun.js" />
</platform>
<platform name="ios">
<!-- iOS 8.0+ -->
<!-- iPad Pro -->
<icon src="../ios/icons/icon-83.5@2x.png" width="167" height="167" />
<!-- iPhone 6 Plus -->
<icon src="../ios/icons/icon-60@3x.png" width="180" height="180" />
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch -->
<icon src="../ios/icons/icon-60@2x.png" width="120" height="120" />
<!-- iPad -->
<icon src="../ios/icons/icon-76.png" width="76" height="76" />
<icon src="../ios/icons/icon-76@2x.png" width="152" height="152" />
<!-- iOS 6.1 -->
<!-- Spotlight Icon -->
<icon src="../ios/icons/icon-40.png" width="40" height="40" />
<icon src="../ios/icons/icon-40@2x.png" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="../ios/icons/icon.png" width="57" height="57" />
<icon src="../ios/icons/icon@2x.png" width="114" height="114" />
<!-- iPad -->
<icon src="../ios/icons/icon-72.png" width="72" height="72" />
<icon src="../ios/icons/icon-72@2x.png" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="../ios/icons/icon-small.png" width="29" height="29" />
<icon src="../ios/icons/icon-small@2x.png" width="58" height="58" />
<icon src="../ios/icons/icon-small@3x.png" width="87" height="87" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="../ios/icons/icon-50.png" width="50" height="50" />
<icon src="../ios/icons/icon-50@2x.png" width="100" height="100" />
<!-- Splash -->
<splash src="../ios/splash/Default~iphone.png" width="320" height="480"/>
<splash src="../ios/splash/Default@2x~iphone.png" width="640" height="960"/>
<splash src="../ios/splash/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="../ios/splash/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
<splash src="../ios/splash/Default-568h@2x~iphone.png" width="640" height="1136"/>
<splash src="../ios/splash/Default-667h.png" width="750" height="1334"/>
<splash src="../ios/splash/Default-736h.png" width="1242" height="2208"/>
</platform>
</widget>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,011 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View file

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="2.5.0.0" />
<mp:PhoneIdentity PhoneProductId="5381aa50-9069-11e4-84cc-293caf9cbdc8" PhonePublisherId="F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" />
<Properties>
<DisplayName>Copay Bitcoin Wallet</DisplayName>
<PublisherDisplayName>BitPay Inc.</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="x5381aa50y9069y11e4y84ccy293caf9cbdc8x" Executable="AGHost.exe" EntryPoint="MainPage.xaml">
<m3:VisualElements DisplayName="Copay Bitcoin Wallet" Square150x150Logo="Assets\SquareTile150x150.png" Square44x44Logo="Assets\Logo.png" Description="A multisignature Bitcoin Wallet" ForegroundText="light" BackgroundColor="#464646">
<m3:DefaultTile Square71x71Logo="Assets\SquareTile71x71.png">
</m3:DefaultTile>
<m3:SplashScreen Image="SplashScreenImage.jpg" />
</m3:VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="AgHost.BackgroundTask">
<BackgroundTasks>
<Task Type="systemEvent" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>AgHostSvcs.dll</Path>
<ActivatableClass ActivatableClassId="AgHost.BackgroundTask" ThreadingModel="both" />
</InProcessServer>
</Extension>
</Extensions>
</Package>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

View file

@ -1,6 +1,6 @@
#/bin/bash
PROJECT=./cordova/project/platforms
PROJECT=./build-wp/platforms
for i in $PROJECT/wp8/www/img/*.svg
do
cat $i |grep -v ?xml > $i
@ -9,4 +9,4 @@ done
for i in $PROJECT/wp8/www/font/*.svg
do
cat $i |grep -v ?xml > $i
done
done