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

CI Build #80

Merged
merged 14 commits into from
Jul 3, 2018
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 19 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down