Mhurd has submitted this change and it was merged. Change subject: makefile & fastlane follow-on ......................................................................
makefile & fastlane follow-on - fix some syntax & rebase errors in the Makefile - add "make" fn to Fastfile which allows make goals to be invoked from the Fastfile - add linting to pre_check fn - DRY up the Fastfile a bit - commit some lint fixes Change-Id: Ic1ffbe0ffc1659a949a727ddd659cf0ee169054e --- M Makefile M fastlane/Fastfile 2 files changed, 59 insertions(+), 25 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Verified; Looks good to me, approved diff --git a/Makefile b/Makefile index 7e3862f..48f30fd 100644 --- a/Makefile +++ b/Makefile @@ -110,20 +110,34 @@ #!!!!! Web dependency management #!!!!! -CSS_ORIGIN = "http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules=" +web: ##Make web assets +web: css grunt + +CSS_ORIGIN = http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules= WEB_ASSETS_DIR = "Wikipedia/assets" -cd "Wikipedia/assets/" && { - curl -L -f -o 'styles.css' "${PREFIX}mobile.app.pagestyles.ios" - curl -L -f -o 'abusefilter.css' "${PREFIX}mobile.app.pagestyles.ios" - curl -L -f -o 'preview.css' "${PREFIX}mobile.app.preview" -} +define get_css_module +curl -s -L -o +endef +css: ##Download latest stylesheets + @echo "Downloading CSS assets..."; \ + mkdir -p $(WEB_ASSETS_DIR); \ + cd $(WEB_ASSETS_DIR); \ + $(get_css_module) 'styles.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \ + $(get_css_module) 'abusefilter.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \ + $(get_css_module) 'preview.css' "$(CSS_ORIGIN)mobile.app.preview" > /dev/null NODE_VERSION = "$(shell node -v 2>/dev/null)" NPM_VERSION = "$(shell npm -version 2>/dev/null)" -npm: ##TODO, run npm install +grunt: ##Run grunt +grunt: npm + @cd www && grunt && cd .. + +npm: ##Install Javascript dependencies +npm: node-check + @cd www && npm install && cd .. get-node: ##Install node via Homebrew brew install node diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c22ed23..660227d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -4,16 +4,27 @@ ENV['XCODE_WORKSPACE'] = 'Wikipedia.xcworkspace' -before_all do - p ENV - reset_git_repo :force unless ENV['NO_RESET'] - ensure_git_status_clean unless ENV['NO_RESET'] - cocoapods - pre_check +# Returns true if the `NO_RESET` env var is set to 1 +def reset_disabled? + ENV['NO_RESET'] == '1' end -def pre_check +# Returns true if the `NO_DEPLOY` env var is set to 1 +def deploy_disabled? + ENV['NO_DEPLOY'] == '1' +end +# Runs goals from the project's Makefile, this requires going up to the project directory. +# :args: Additional arguments to be passed to `make`. +# Returns The result of the `make` command +def make(args) + # Maybe we should write an "uncrustify" fastlane action?... + Dir.chdir '..' do + sh 'make ' + args + end +end + +def run_unit_tests xctest({ scheme: 'Wikipedia', destination: "platform=iOS Simulator,name=iPhone 6,OS=8.2", @@ -21,15 +32,23 @@ report_path: "build/reports/iOS82/report.xml", clean: nil }) +end +before_all do + p ENV + unless reset_disabled? + reset_git_repo :force + ensure_git_status_clean + end end lane :test do - + make 'lint' end lane :alpha do - + run_unit_tests + # Download the Certificate for signing cert @@ -61,7 +80,7 @@ # verbose: nil, # this means 'Do Verbose'. }) - unless ENV['NO_DEPLOY'] + unless deploy_disabled? # Upload the DSYM to Hockey hockey({ api_token: 'c881c19fd8d0401682c4640b7948ef5e', @@ -76,6 +95,8 @@ end lane :beta do + run_unit_tests + # Download the Certificate for signing cert @@ -106,7 +127,7 @@ archive: nil }) - unless ENV['NO_DEPLOY'] + unless deploy_disabled? # Upload the DSYM to Hockey hockey({ api_token: 'c881c19fd8d0401682c4640b7948ef5e', @@ -120,18 +141,17 @@ end lane :appstore do + run_unit_tests snapshot frameit - unless ENV['NO_DEPLOY'] + unless deploy_disabled? deliver :skip_deploy, :force end end -after_all do |lane| +# after_all do |lane| +# end -end +# error do |lane, exception| +# end - -error do |lane, exception| - # Something bad happened -end -- To view, visit https://gerrit.wikimedia.org/r/202649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1ffbe0ffc1659a949a727ddd659cf0ee169054e Gerrit-PatchSet: 3 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Bgerstle <bgers...@wikimedia.org> Gerrit-Reviewer: Bgerstle <bgers...@wikimedia.org> Gerrit-Reviewer: Dr0ptp4kt <ab...@wikimedia.org> Gerrit-Reviewer: Fjalapeno <cfl...@wikimedia.org> Gerrit-Reviewer: Mhurd <mh...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits