Class: FlutterRb::PluginGradleAndroidPackageCheck
- Defined in:
- lib/flutter_rb/checks/plugin_gradle_check.rb
Overview
This class represents a check for validating that the ‘android’ package does not exist in the Gradle project configuration.
Constant Summary
Constants inherited from Check
Instance Method Summary collapse
-
#check(project) ⇒ CheckReport
Performs the check on the given project.
-
#description ⇒ String
Returns the description of the check.
-
#name ⇒ String
Returns the name of the check.
Instance Method Details
#check(project) ⇒ CheckReport
Performs the check on the given project.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/flutter_rb/checks/plugin_gradle_check.rb', line 28 def check(project) # Get the Gradle configuration file. gradle = project.android_folder.gradle # Check if the 'package android' line exists in the build.gradle file. import_exist = File.readlines("#{gradle.path}/build.gradle").grep(/package android/).size.positive? # Create a check report based on the result. CheckReport.new( name, import_exist ? ::CheckReportStatus::ERROR : ::CheckReportStatus::NORMAL, description, gradle.path ) end |
#description ⇒ String
Returns the description of the check.
20 21 22 |
# File 'lib/flutter_rb/checks/plugin_gradle_check.rb', line 20 def description 'Validate that \android\ package not exists in Gradle project config (build.gradle file)' end |
#name ⇒ String
Returns the name of the check.
13 14 15 |
# File 'lib/flutter_rb/checks/plugin_gradle_check.rb', line 13 def name 'PluginGradleAndroidPackageCheck' end |