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

Create Rake File Tasks #14

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@mkchoi212
Contributor

mkchoi212 commented May 23, 2018

fastlane folder has been created with a simple lane that runs tests for MobileVLCKit; which is empty as of right now :p

@carolanitz

This comment has been minimized.

Member

carolanitz commented May 23, 2018

I think for MobileVLCKit we don't need to use fastlane and we can work directly with xcodebuild in the circleci yaml

@mkchoi212 mkchoi212 force-pushed the mkchoi212:fastlane-setup branch from d32f11e to fdf546e May 23, 2018

@mkchoi212 mkchoi212 changed the title from Setup fastlane to Create Rake File Tasks May 23, 2018

@mkchoi212

This comment has been minimized.

Contributor

mkchoi212 commented May 23, 2018

So instead of using fastlane, I've decided to use rake in order to organize all the required commands to build/test VLCKit; I was looking around the web and got inspired by the folks at PSPDFKit.

These tasks will later be called from CircleCI during the building/testing stages.

@mkchoi212 mkchoi212 force-pushed the mkchoi212:fastlane-setup branch 4 times, most recently from d3b8ecf to 7dce59e May 23, 2018

Rakefile Outdated
SCHEME_IOS = "MobileVLCKit"
PROJECT_IOS = "MobileVLCKit.xcodeproj"
VLC_FLAGS_SIM = "-da x86_64"

This comment has been minimized.

@carolanitz

carolanitz May 25, 2018

Member

If you only use SDK_SIM_DEST, SDK_SIM, VLC_FLAGS_SIM in one place there is no need to define them here.

This comment has been minimized.

@Mikanbu

Mikanbu May 25, 2018

Member

Do we maybe want to add -v option as well for more info?

This comment has been minimized.

@mkchoi212

mkchoi212 May 25, 2018

Contributor

@carolanitz I took them out as vars because they are going to be used often later on. i.e. when task for code coverage is added on

Rakefile Outdated
SDK_SIM = "iphonesimulator11.3"
SDK_SIM_DEST = "'platform=iOS Simulator,name=iPhone 7,OS=11.3'"
SCHEME_IOS = "MobileVLCKit"

This comment has been minimized.

@carolanitz

carolanitz May 25, 2018

Member

right now the testing and build scheme are called the same which is very confusing. Can we rename it to also include the name test?

Rakefile Outdated
required_dirs = ["./libvlc/vlc/install-iPhone", "./libvlc/vlc/install-iPhoneSimulator", "./libvlc/vlc/build-iPhoneSimulator"]
if File.exist?(plugin_file) and dirs_exist?(required_dirs)
puts "Found pre-existing build directory. Skipping build"

This comment has been minimized.

@carolanitz

carolanitz May 25, 2018

Member

I actually think you don't need to check for this since the compileAndBuild will be already fast if those directories exist

This comment has been minimized.

@mkchoi212

mkchoi212 May 25, 2018

Contributor

Hmmm on my machine, it takes about 15 minutes to do a build even when those directories exist 🤔

This comment has been minimized.

@mkchoi212

mkchoi212 May 25, 2018

Contributor

Also I'm not 100% how it works yet but I think every time a CI build is triggered, it clones a fresh version of the repo, therefore removing the previous build directories

This comment has been minimized.

@carolanitz

carolanitz May 28, 2018

Member

Yes, that's actually true you would need to build a cache yourself. We would need to make sure that we don't use the cache when we add for example a new patch or change something in the compileAndBuildVLCKit.sh

This comment has been minimized.

@mkchoi212

mkchoi212 May 28, 2018

Contributor

If compileAndBuildVLCKit.sh changes, CircleCI will do a rebuild. It's done in .circle.ci/config.yml with this

- save_cache:
    key: libvlc-{{ checksum "compileAndBuildVLCKit.sh" }}

I'm not sure about adding new patches though cause I haven't really figured out how patches work yet :p

Rakefile Outdated
puts "Building VLCKit (iOS Simulator)"
plugin_file = "Resources/MobileVLCKit/vlc-plugins-iPhone.h"
required_dirs = ["./libvlc/vlc/install-iPhone", "./libvlc/vlc/install-iPhoneSimulator", "./libvlc/vlc/build-iPhoneSimulator"]

This comment has been minimized.

@carolanitz

carolanitz May 25, 2018

Member

do you really need iPhone when you just build for the Simulator?

@mkchoi212 mkchoi212 force-pushed the mkchoi212:fastlane-setup branch 8 times, most recently from 5c84e8d to 04d6d05 May 25, 2018

@mkchoi212 mkchoi212 force-pushed the mkchoi212:fastlane-setup branch from 04d6d05 to 3fe7880 May 25, 2018

def dirs_exist?(directories)
directories.each do |dir|
return false unless Dir.exist?(dir)

This comment has been minimized.

@carolanitz

carolanitz May 28, 2018

Member

can't you just do this?

return Dir.exist?(dir)

This comment has been minimized.

@mkchoi212

mkchoi212 May 28, 2018

Contributor

Are you talking about replacing the for-loop with Dir.exist?(dir_1) && Dir.exist?(dir_2)?

This comment has been minimized.

@carolanitz

carolanitz May 28, 2018

Member

no just replace the return false unless Dir.exist?(dir) with return Dir.exist?(dir) but I actually don't know enough about ruby. So I'm genuinely asking because I don't know

This comment has been minimized.

@mkchoi212

mkchoi212 May 28, 2018

Contributor

If you do that, the for-loop would return after only evaluating the first element in the directories array.

return false unless Dir.exist?(dir), returns a false if and only if Dir.exist?(dir) evaluates to false.

If the loop doesn't return, the function implicitly returns a true

This comment has been minimized.

@mkchoi212

mkchoi212 May 28, 2018

Contributor

I originally had something like

def dirs_exist?(directories)
  directories.each { |dir| 
    if Dir.exist?(x) == false { 
       return false
    }
  }
  return true 

but rubocop kept yelling at me until I got to what I have right now :D

@mkchoi212 mkchoi212 closed this May 28, 2018

@mkchoi212 mkchoi212 reopened this May 28, 2018

@mkchoi212

This comment has been minimized.

Contributor

mkchoi212 commented May 28, 2018

I just saw that 23515c7 hasn't been merged yet.

@Mikanbu

This comment has been minimized.

Member

Mikanbu commented May 28, 2018

Seems that it has with cb34d56

@Mikanbu Mikanbu closed this May 28, 2018

@mkchoi212 mkchoi212 deleted the mkchoi212:fastlane-setup branch Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment