diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..e753dfb7f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +os: osx +osx_image: xcode9.3 +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ +cache: + bundler: true + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + - $HOME/.android/build-cache + - $HOME/Library/Caches/Homebrew +env: + global: + - TERM=dumb + - ANDROID_HOME=/usr/local/share/android-sdk + - MONO_URL="https://download.mono-project.com/archive/5.12.0/macos-10-universal/MonoFramework-MDK-5.12.0.226.macos10.xamarin.universal.pkg" + - UNITY_URL="https://download.unity3d.com/download_unity/21ae32b5a9cb/MacEditorInstaller/Unity-2017.4.3f1.pkg" +install: + - brew tap caskroom/cask + - brew cask install android-sdk + - yes | sdkmanager "platforms;android-27" + - yes | sdkmanager --licenses + - curl -o Mono.pkg $MONO_URL & curl -o Unity.pkg $UNITY_URL & wait + - sudo installer -dumplog -package Mono.pkg -target / + - export PATH="$PATH:/Library/Frameworks/Mono.framework/Versions/Current/Commands" + - sudo installer -dumplog -package Unity.pkg -target / + - bundle install +script: bundle exec rake diff --git a/README.md b/README.md index 7f663b10e..b9377c495 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Bugsnag exception reporter for Unity [![Documentation](https://img.shields.io/badge/documentation-latest-blue.svg)](http://docs.bugsnag.com/platforms/unity/) +[![Build status](https://travis-ci.org/bugsnag/bugsnag-unity.svg?branch=master)](https://travis-ci.org/bugsnag/bugsnag-unity) The Bugsnag Notifier for Unity gives you instant notification of exceptions thrown from your Unity games on iOS and Android devices, as well as standalone diff --git a/Rakefile b/Rakefile index 4b8ff8d0b..53f5df389 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,16 @@ $UNITY = ['/Applications/Unity/Unity.app/Contents/MacOS/Unity', 'C:\Program File File.exists? unity end +def unity(*cmd) + cmd = cmd.unshift($UNITY, "-batchmode", "-nographics", "-logFile", "unity.log", "-quit") + sh *cmd do |ok, res| + if !ok + sh "cat", "unity.log" + raise "unity error" + end + end +end + desc "Build the plugin" task :build do path = File.expand_path "temp.unityproject" @@ -14,18 +24,19 @@ task :build do end rm_rf "temp.unityproject" - sh $UNITY, "-batchmode", "-quit", "-createproject", path + rm_rf "Bugsnag.unitypackage" + unity "-createproject", path Rake::Task[:copy_into_project].invoke(path) # Create the package so that the metadata files are created - sh $UNITY, "-batchmode", "-quit", "-projectpath", path, "-exportpackage", "Assets", "Bugsnag.unitypackage" + unity "-projectpath", path, "-exportpackage", "Assets", "Bugsnag.unitypackage" # Add support for tvOS to the iOS files by modifying the metadata Rake::Task[:include_tvos_support].invoke(path) # Create the package with the new metadata - sh $UNITY, "-batchmode", "-quit", "-projectpath", path, "-exportpackage", "Assets", "Bugsnag.unitypackage" + unity "-projectpath", path, "-exportpackage", "Assets", "Bugsnag.unitypackage" cp "#{path}/Bugsnag.unitypackage", "." end @@ -37,11 +48,11 @@ end task :clean do cd 'bugsnag-android' do - sh "./gradlew", "clean" + sh "./gradlew", "clean", "--quiet" end cd 'bugsnag-android-unity' do cp "../bugsnag-android/gradle.properties", "gradle.properties" - sh "../bugsnag-android/gradlew", "clean" + sh "../bugsnag-android/gradlew", "clean", "--quiet" end cd 'bugsnag-cocoa' do sh "make", "clean" @@ -104,7 +115,7 @@ task :create_ios_plugin, [:path] do |task, args| kscrash_filter_path = kscrash_dir + "Reporting/Filters/" `find #{recording_path} #{reporting_path} #{bugsnag_path} #{recording_sentry_path} #{recording_tools_path} #{kscrash_filter_path} -name '*.m' -or -name '*.c' -or -name '*.mm' -or -name '*.h' -or -name '*.cpp'`.split("\n").each do |x| - cp x, ios_dir + cp x, ios_dir, verbose: false end # Copy unity to bugsnag-cocoa wrapper @@ -127,12 +138,12 @@ task :create_android_plugin, [:path] do |task, args| # Create clean build of the android notifier cd 'bugsnag-android' do - sh "./gradlew sdk:build" + sh "./gradlew", "sdk:build", "--quiet" end cd 'bugsnag-android-unity' do cp "../bugsnag-android/gradle.properties", "gradle.properties" - sh "../bugsnag-android/gradlew build" + sh "../bugsnag-android/gradlew", "build", "--quiet" end cp "bugsnag-android/sdk/build/outputs/aar/bugsnag-android-release.aar", android_dir