Open ThomasGrunewald opened 9 years ago
I am too looking for the same especially in this tool itself. One place for everything.
You can add arbitrary ruby code to .crafter steps, so you could potentialy create directories like this:
FileUtils.mkdir_p '/ViewControllers'
FileUtils.mkdir_p '/Models'
Didn't work? Execution was successful Also is there any was to set certificate and Provisional Profile for each build setting set Below is the sample build settings added to crafter.rb file
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafterDemo, :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'TEST DEBUG' }, configuration: :TEST_DEBUG)
bash-3.2# crafter duplicating configurations setting up variety of options set specified values for build settings preparing git ignore preparing pod file adding scripts Finished.
make sure you add require 'fileutils'
to top of the file.
build settings you pasted are missing '
and are spelled incorrectly :)
as for provisioning profile you could:
PROVISIONING_PROFILE=395525c8-8407-4d30-abbd-b65907223eec
where the long hex number is the UUID of the profile. If you look inside a provisioning profile you'll find that most of it is ASCII, even though it's a binary file, and it has a section like this
UUID
395525c8-8407-4d30-abbd-b65907223eec
Still not able to create folder.
Also that build settings i edited here so missed ' :) Also where should i add this PROVISIONING_PROFILE option. It should be inside each set_build_settings. Correct me if i am wrong.
Any help on folder creation still not able to create folders.
Below is my sample crafter.rb file.
Please let me know if PROVISIONING_PROFILE is correctly added. Also i am not able to create folders.
require 'fileutils'
load "#{Crafter::ROOT}/config/default_scripts.rb"
Crafter.configure do
add_platform({:platform => :ios, :deployment => 7.0}) add_git_ignore duplicate_configurations({:TEST_DEBUG => :debug, :TEST_RELEASE => :release, :SIT_DEBUG => :debug, :SIT_RELEASE => :release, :UAT_DEBUG => :debug, :UAT_RELEASE => :release, :PROD_DEBUG => :debug, :PROD_RELEASE => :release})
set_options %w( GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED GCC_WARN_MISSING_PARENTHESES GCC_WARN_ABOUT_RETURN_TYPE GCC_WARN_SIGN_COMPARE GCC_WARN_CHECK_SWITCH_STATEMENTS GCC_WARN_UNUSED_FUNCTION GCC_WARN_UNUSED_LABEL GCC_WARN_UNUSED_VALUE GCC_WARN_UNUSED_VARIABLE GCC_WARN_SHADOW GCC_WARN_64_TO_32_BIT_CONVERSION GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS GCC_WARN_UNDECLARED_SELECTOR GCC_WARN_TYPECHECK_CALLS_TO_PRINTF GCC_WARN_UNINITIALIZED_AUTOS CLANG_WARN_INT_CONVERSION CLANG_WARN_ENUM_CONVERSION CLANG_WARN_CONSTANT_CONVERSION CLANG_WARN_BOOL_CONVERSION CLANG_WARN_EMPTY_BODY CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION GCC_WARN_64_TO_32_BIT_CONVERSION
RUN_CLANG_STATIC_ANALYZER
GCC_TREAT_WARNINGS_AS_ERRORS
)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'TEST DEBUG', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :TEST_DEBUG)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'TEST RELEASE', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :TEST_RELEASE)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'SIT DEBUG', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :SIT_DEBUG)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'SIT RELEASE', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :SIT_RELEASE)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'UAT DEBUG', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :UAT_DEBUG)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'UAT RELEASE', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :UAT_RELEASE)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'PROD DEBUG', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :PROD_DEBUG)
set_build_settings({ :'BUNDLE_ID_SUFFIX' => 'com.test.crafter', :'BUNLDE_DISPLAY_NAME_SUFFIX' => 'PROD RELEASE', PROVISIONING_PROFILE => xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }, configuration: :PROD_RELEASE)
FileUtils.mkdir_p '/ViewController' FileUtils.mkdir_p '/Models' FileUtils.mkdir_p '/ExternalComponents' FileUtils.mkdir_p '/Common'
# each target have set of pods
#pods << %w(NSLogger-CocoaLumberjack-connector TestFlightSDK)
# each target can have optional blocks, eg. crafter will ask you if you want to include networking with a project
#add_option :networking do
#pods << 'AFNetworking'
#end
#add_option :coredata do
#pods << 'MagicalRecord'
#end
# each target can have shell scripts added, in this example we are adding my icon versioning script as in http://www.merowing.info/2013/03/overlaying-application-version-on-top-of-your-icon/
#scripts << {:name => 'icon versioning', :script => Crafter.icon_versioning_script}
# we can also execute arbitrary ruby code when configuring our projects, here we rename all our standard icon* to icon_base for versioning script
#icon_rename = proc do |file|
# extension = File.extname(file)
# file_name = File.basename(file, extension)
# File.rename(file, "#{File.dirname(file)}/#{file_name}_base#{extension}")
#end
#Dir['**/Icon.png'].each(&icon_rename)
#Dir['**/Icon@2x.png'].each(&icon_rename)
#Dir['**/Icon-72.png'].each(&icon_rename)
#Dir['**/Icon-72@2x.png'].each(&icon_rename)
# pods << 'Kiwi'
# scripts << {:name => 'command line unit tests', :script => Crafter.command_line_test_script}
#end
end
Thanks for reply.
What I meant was the Groups-Structure in the Xcode-Project. Is there an way to predefining this structure like ViewControllers, Model, ViewModel etc. ? And than transport this structure to the project file structure (finder).
Hi, I have posted below my crafter.rb file. Had removed Provisional Profile and CodeSigning for security reasons. Below are the issues i am facing:
What am i missing here?
require 'fileutils'
load "#{Crafter::ROOT}/config/default_scripts.rb"
Crafter.configure do FileUtils.mkdir_p '/Models'
add_platform({:platform => :ios, :deployment => 7.0}) add_git_ignore duplicate_configurations({:TEST_DEBUG => :debug, :TEST_RELEASE => :release, :SIT_DEBUG => :debug, :SIT_RELEASE => :release, :UAT_DEBUG => :debug, :UAT_RELEASE => :release, :PROD_DEBUG => :debug, :PROD_RELEASE => :release})
set_options %w( GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED GCC_WARN_MISSING_PARENTHESES GCC_WARN_ABOUT_RETURN_TYPE GCC_WARN_SIGN_COMPARE GCC_WARN_CHECK_SWITCH_STATEMENTS GCC_WARN_UNUSED_FUNCTION GCC_WARN_UNUSED_LABEL GCC_WARN_UNUSED_VALUE GCC_WARN_UNUSED_VARIABLE GCC_WARN_SHADOW GCC_WARN_64_TO_32_BIT_CONVERSION GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS GCC_WARN_UNDECLARED_SELECTOR GCC_WARN_TYPECHECK_CALLS_TO_PRINTF GCC_WARN_UNINITIALIZED_AUTOS CLANG_WARN_INT_CONVERSION CLANG_WARN_ENUM_CONVERSION CLANG_WARN_CONSTANT_CONVERSION CLANG_WARN_BOOL_CONVERSION CLANG_WARN_EMPTY_BODY CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION GCC_WARN_64_TO_32_BIT_CONVERSION RUN_CLANG_STATIC_ANALYZER GCC_TREAT_WARNINGS_AS_ERRORS )
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.testdebug.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_TESTD',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.testrelease.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_TESTR',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.sitdebug.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_SITD',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.sitrelease.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_SITR',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.uatdebug.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_UATD',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.uatrelease.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_UATR',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.proddebug.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_PRDD',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
set_build_settings({
:'BUNDLE_ID_SUFFIX' => 'com.prodrelease.crafter',
:'BUNDLE_DISPLAY_NAME_SUFFIX' => '$(PRODUCT_NAME)_PRDR',
:'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '
Is there a way to define an initial folder structure (ViewControllers, Views, Cells etc.) for the Xcode-project?
Thank you for this great tool!