Class: FlutterRb::PluginGradleVersionCheck
- Defined in:
- lib/flutter_rb/checks/plugin_gradle_check.rb
Overview
This class represents a check for validating the version of the plugin 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.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/flutter_rb/checks/plugin_gradle_check.rb', line 65 def check(project) # Get the version of the plugin from the pubspec file. version_in_pubspec = project.pubspec.pubspec_info.version # Get the Gradle configuration file. gradle = project.android_folder.gradle # Get the version of the plugin from the Gradle build file. version_in_gradle = gradle.version # Create a check report based on the result. CheckReport.new( name, version_in_pubspec == version_in_gradle ? ::CheckReportStatus::NORMAL : ::CheckReportStatus::WARNING, description, gradle.path ) end |
#description ⇒ String
Returns the description of the check.
57 58 59 |
# File 'lib/flutter_rb/checks/plugin_gradle_check.rb', line 57 def description 'Check plugin version in Gradle project config (build.gradle file)' end |
#name ⇒ String
Returns the name of the check.
50 51 52 |
# File 'lib/flutter_rb/checks/plugin_gradle_check.rb', line 50 def name 'PluginGradleVersionCheck' end |