README in dev-1.0.223 vs README in dev-1.0.224

- old
+ new

@@ -1,80 +1,104 @@ =dev (README) -the dev gem provides functionality to support the development of ruby,c#,c++ and c projects. -dev may be used to auto generate rake tasks - - =dev -the dev gem provides functionality to support the development of ruby,c#,c++ and c projects. -when the require 'dev' is used in a rakefile, the variable DEV is defined as well as -several rake tasks. -the DEV variable may be manipulated to modify behavior of defined tasks or to +The dev gem may be used to auto generate rake tasks for a rakefile.rb +A constant hash DEV is defined that is populated based on the content +of the directory in which a rakefile.rb resides. +The dev gem provides task definitions to support the development of ruby,c#,c++ and c projects. +The DEV variable may be manipulated to modify the behavior of defined tasks or to cause additional task to be generated. ==Installation dev can be installed by the single command gem install dev ==Usage -dev can be included in a ruby script with +dev can be included in a rakefile.rb with require 'dev' -a constant DEV hash is the primary variable about which the dev functionality revolves -some example usages: - PROJECT=Dev::Project.new{( name: 'HelloRuby' )} - -===Simplest usage -DEV_HOME/wrk/Examples/HelloRuby/trunk/rakefile.rb - require 'dev' - ==Reference ===Variables ====DEV is a global instance of a Hash. The variable is define by require 'dev' statement DEV may define several keys automatically -=====DEV[scm_uri] the uri for the source code management system. -=====DEV[:scm_type] the type of source code managment, (none,svn,git). -=====DEV[:directory] the full directory name of the rakefile.rb. -=====DEV[:fullname] the name of the project (inferred by directory structure relative to DEV_ROOT). -=====DEV[:version] the version specified by the .semver file. -=====DEV[:dev_root] the root working directory ENV['DEV_ROOT'] if defined, otherwise user home directory. -=====DEV[:toolset] the boost build toolset, if available -=====DEV[:paths] a hash containing various environment paths + DEV[:scm_uri] # the uri for the source code management system. + DEV[:scm_type] # the type of source code managment, (none,svn,git). + DEV[:directory] # the full directory name of the rakefile.rb. + DEV[:fullname] # the name of the project (inferred by directory structure relative to DEV_ROOT). + DEV[:version] # the version specified by the .semver file. + DEV[:src_glob] # the glob pattern(s) defining the source files. + DEV[:dev_root] # the root working directory ENV['DEV_ROOT'] if defined, otherwise user home directory. + DEV[:toolset] # the boost build toolset, if available + DEV[:paths] # a hash containing various environment paths ====CLEAN is a Rake::FileList that specifies file(s) to be removed during the clean task. + CLEAN.include('doc') ====CLOBBER is a Rake::FileList that specifies file(s) to be removed during the clobber task. + CLOBBER.include('obj') ====BUILD_PRODUCTS is a Rake::FileList that specified file(s) that are required to consume the project. ===Tasks - rake add # add files defined by src_glob to source code management - rake check # checks if the project default task may be skipped - rake clean # Remove any temporary products. - rake clobber # Remove any generated file. - rake commit # commit - rake compile # compile - rake features # tests cucumber features - rake info # display information about the rakefile - rake loc # count the lines of code - rake pull # rake working copies of dependencies - rake replace # replace text - rake setup # setup the project environment - rake test # run unit tests - rake update # updates changes from source code management - rake default # is automatically generated by require 'dev' or TASKS.refresh - # to prevent automatic generation of default task, - # define DEV_NO_DEFAULT_TASK prior to require 'dev' - # the automatically generated task will execute the following tasks (if defined) - # ["check","setup","replace","pre_compile","compile","post_compile","pre_test", - # "test","post_test","log_build_products","add","commit","update","finalize"] - # defining an array of string named DEFAULT_TASK_ORDER will cause - # the default task to contain those tasks (if defined). +dev will automatically generated the following tasks as applicable. + rake add # add files defined by src_glob to source code management, not generated if no scm can be detected. + rake check # checks if the project default task may be skipped + rake clean # Remove any temporary products. + rake clobber # Remove any generated file. + rake commit # commits to scm. not generated if no scm detected. + rake compile # compile command(s). + rake features # tests cucumber features + rake info # display information about the rakefile + rake replace # replace text + rake setup # setup the project environment + rake test # run unit tests + rake update # updates changes from source code management + rake default # the default task for the rakefile +If either pre_compile or post_compile tasks are manually created, then TASKS.refresh is called, +these task will be executed in the correct sequence (either before or after compile task) by the default task + require 'dev' + + task :pre_compile do + puts 'pre_compile' + end + + task :post_compile + puts 'post_compile' + end + + TASKS.refresh + +the default task is automatically generated by require 'dev'. It will be defined as dependent on the following tasks if they are defined: + ["check","setup","replace","pre_compile","compile","post_compile","pre_test", + "test","post_test","log_build_products","add","commit","update","finalize"] +to prevent the default task from being defined, define DEV_NO_DEFAULT_TASK prior to require 'dev' + DEV_NO_DEFAULT_TASK=1 + require 'dev' + + # now, can manually define default task + task :default do + puts "hello default task" + end +to provide a custom set of default dependencies, the DEFAULT_TASK_ORDER may be defined prior to require 'dev', +then a call to TASKS.refresh can be made to redefine the default task + DEFAULT_TASK_ORDER=["step1","step2"] + require 'dev' + + task :step1 do + puts "step1" + end + + task :step2 do + puts "step2" + end + + TASKS.refresh + ==License Copyright 2012-2013 Lou Parslow - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 +http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file