Class: Fastlane::Actions::ClocAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::ClocAction
- Defined in:
- lib/fastlane/actions/cloc.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Methods inherited from Fastlane::Action
action_name, author, output, return_value, sh, step_text
Class Method Details
.authors ⇒ Object
63 64 65 |
# File 'lib/fastlane/actions/cloc.rb', line 63 def self. ["intere"] end |
.available_options ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fastlane/actions/cloc.rb', line 32 def self. [ FastlaneCore::ConfigItem.new(key: :binary_path, env_name: "FL_CLOC_BINARY_PATH", description: "Where the cloc binary lives on your system (full path including 'cloc')", optional: true, is_string: true, default_value: '/usr/local/bin/cloc'), FastlaneCore::ConfigItem.new(key: :exclude_dir, env_name: "FL_CLOC_EXCLUDE_DIR", description: "Comma separated list of directories to exclude", # a short description of this parameter optional: true, is_string: true), FastlaneCore::ConfigItem.new(key: :output_directory, env_name: "FL_CLOC_OUTPUT_DIRECTORY", description: "Where to put the generated report file", is_string: true, default_value: "build"), FastlaneCore::ConfigItem.new(key: :source_directory, env_name: "FL_CLOC_SOURCE_DIRECTORY", description: "Where to look for the source code (relative to the project root folder)", is_string: true, default_value: ""), FastlaneCore::ConfigItem.new(key: :xml, env_name: "FL_CLOC_XML", description: "Should we generate an XML File (if false, it will generate a plain text file)?", is_string: false, default_value: true) ] end |
.description ⇒ Object
24 25 26 |
# File 'lib/fastlane/actions/cloc.rb', line 24 def self.description "Generates a Code Count that can be read by Jenkins (xml format)" end |
.details ⇒ Object
28 29 30 |
# File 'lib/fastlane/actions/cloc.rb', line 28 def self.details "This action will run cloc to generate a SLOC report that the Jenkins SLOCCount plugin can read. See https://wiki.jenkins-ci.org/display/JENKINS/SLOCCount+Plugin for more information." end |
.is_supported?(platform) ⇒ Boolean
67 68 69 |
# File 'lib/fastlane/actions/cloc.rb', line 67 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fastlane/actions/cloc.rb', line 4 def self.run(params) cloc_binary = params[:binary_path] exclude_dirs = params[:exclude_dir].nil? ? '' : "--exclude-dir=#{params[:exclude_dir]}" xml_format = params[:xml] out_dir = params[:output_directory] output_file = xml_format ? "#{out_dir}/cloc.xml" : "#{out_dir}/cloc.txt" source_directory = params[:source_directory] command = [ cloc_binary, exclude_dirs, '--by-file', xml_format ? '--xml ' : '', "--out=#{output_file}", source_directory ].join(' ').strip Actions.sh command end |