flutter_rb 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +20 -20
- data/README.md +144 -144
- data/bin/frb +19 -19
- data/lib/checkstyle_report/checkstyle_report.rb +90 -90
- data/lib/flutter_rb/checks/check.rb +24 -24
- data/lib/flutter_rb/checks/plugin_directories_check.rb +33 -33
- data/lib/flutter_rb/checks/plugin_gradle_check.rb +57 -57
- data/lib/flutter_rb/checks/plugin_podspec_check.rb +109 -109
- data/lib/flutter_rb/checks/plugin_pubspec_check.rb +152 -152
- data/lib/flutter_rb/config/flutter_rb_config.rb +16 -16
- data/lib/flutter_rb/config/flutter_rb_config_initializer.rb +56 -56
- data/lib/flutter_rb/project/project.rb +53 -53
- data/lib/flutter_rb/project/specs/android/android_folder.rb +13 -13
- data/lib/flutter_rb/project/specs/android/gradle.rb +27 -27
- data/lib/flutter_rb/project/specs/flutter/dev_dependency.rb +11 -11
- data/lib/flutter_rb/project/specs/flutter/platform_plugin.rb +18 -18
- data/lib/flutter_rb/project/specs/flutter/pubspec.rb +69 -69
- data/lib/flutter_rb/project/specs/flutter/pubspec_info.rb +20 -20
- data/lib/flutter_rb/project/specs/ios/ios_folder.rb +14 -14
- data/lib/flutter_rb/project/specs/ios/podspec.rb +40 -40
- data/lib/flutter_rb/report/check_report.rb +47 -47
- data/lib/flutter_rb.rb +93 -93
- metadata +9 -37
@@ -1,33 +1,33 @@
|
|
1
|
-
require_relative 'check'
|
2
|
-
require_relative '../report/check_report'
|
3
|
-
|
4
|
-
module FlutterRb
|
5
|
-
# Check plugin directories structure.
|
6
|
-
# Example: if a Flutter plugin has only Android specific code
|
7
|
-
# but not contains iOS folder with description, then iOS build fails
|
8
|
-
class PluginDirectoriesCheck < Check
|
9
|
-
def name
|
10
|
-
'PluginDirectoriesCheck'
|
11
|
-
end
|
12
|
-
|
13
|
-
def summary
|
14
|
-
'Validate Flutter plugin structure'
|
15
|
-
end
|
16
|
-
|
17
|
-
def description
|
18
|
-
'Check plugin directories structure in pubspec file'
|
19
|
-
end
|
20
|
-
|
21
|
-
def check(project)
|
22
|
-
android_exists = !project.android_folder.nil?
|
23
|
-
ios_exists = !project.ios_folder.nil?
|
24
|
-
check_result = android_exists && ios_exists || !android_exists && !ios_exists
|
25
|
-
CheckReport.new(
|
26
|
-
name,
|
27
|
-
check_result ? CheckReportStatus::NORMAL : CheckReportStatus::ERROR,
|
28
|
-
description,
|
29
|
-
project.path
|
30
|
-
)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
1
|
+
require_relative 'check'
|
2
|
+
require_relative '../report/check_report'
|
3
|
+
|
4
|
+
module FlutterRb
|
5
|
+
# Check plugin directories structure.
|
6
|
+
# Example: if a Flutter plugin has only Android specific code
|
7
|
+
# but not contains iOS folder with description, then iOS build fails
|
8
|
+
class PluginDirectoriesCheck < Check
|
9
|
+
def name
|
10
|
+
'PluginDirectoriesCheck'
|
11
|
+
end
|
12
|
+
|
13
|
+
def summary
|
14
|
+
'Validate Flutter plugin structure'
|
15
|
+
end
|
16
|
+
|
17
|
+
def description
|
18
|
+
'Check plugin directories structure in pubspec file'
|
19
|
+
end
|
20
|
+
|
21
|
+
def check(project)
|
22
|
+
android_exists = !project.android_folder.nil?
|
23
|
+
ios_exists = !project.ios_folder.nil?
|
24
|
+
check_result = android_exists && ios_exists || !android_exists && !ios_exists
|
25
|
+
CheckReport.new(
|
26
|
+
name,
|
27
|
+
check_result ? CheckReportStatus::NORMAL : CheckReportStatus::ERROR,
|
28
|
+
description,
|
29
|
+
project.path
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,57 +1,57 @@
|
|
1
|
-
require_relative './check'
|
2
|
-
require_relative '../report/check_report'
|
3
|
-
|
4
|
-
module FlutterRb
|
5
|
-
# Check 'android; import not exists in Gradle project config (build.gradle file)
|
6
|
-
class PluginGradleAndroidPackageCheck < Check
|
7
|
-
def name
|
8
|
-
'PluginGradleAndroidPackageCheck'
|
9
|
-
end
|
10
|
-
|
11
|
-
def summary
|
12
|
-
'Validate that \android\ package not exists in build.gradle config'
|
13
|
-
end
|
14
|
-
|
15
|
-
def description
|
16
|
-
'Validate that \android\ package not exists in Gradle project config (build.gradle file)'
|
17
|
-
end
|
18
|
-
|
19
|
-
def check(project)
|
20
|
-
gradle = project.android_folder.gradle
|
21
|
-
import_exist = File.readlines("#{gradle.path}/build.gradle").grep(/package android/).size.positive?
|
22
|
-
CheckReport.new(
|
23
|
-
name,
|
24
|
-
import_exist ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
25
|
-
description,
|
26
|
-
gradle.path
|
27
|
-
)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# Check Flutter plugin version in Gradle project config (build.gradle file)
|
32
|
-
class PluginGradleVersionCheck < Check
|
33
|
-
def name
|
34
|
-
'PluginGradleVersionCheck'
|
35
|
-
end
|
36
|
-
|
37
|
-
def summary
|
38
|
-
'Validate Flutter plugin\s version in build.gradle file'
|
39
|
-
end
|
40
|
-
|
41
|
-
def description
|
42
|
-
'Check plugin version in Gradle project config (build.gradle file)'
|
43
|
-
end
|
44
|
-
|
45
|
-
def check(project)
|
46
|
-
version_in_pubspec = project.pubspec.pubspec_info.version
|
47
|
-
gradle = project.android_folder.gradle
|
48
|
-
version_in_gradle = gradle.version
|
49
|
-
CheckReport.new(
|
50
|
-
name,
|
51
|
-
version_in_pubspec == version_in_gradle ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
52
|
-
description,
|
53
|
-
gradle.path
|
54
|
-
)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
1
|
+
require_relative './check'
|
2
|
+
require_relative '../report/check_report'
|
3
|
+
|
4
|
+
module FlutterRb
|
5
|
+
# Check 'android; import not exists in Gradle project config (build.gradle file)
|
6
|
+
class PluginGradleAndroidPackageCheck < Check
|
7
|
+
def name
|
8
|
+
'PluginGradleAndroidPackageCheck'
|
9
|
+
end
|
10
|
+
|
11
|
+
def summary
|
12
|
+
'Validate that \android\ package not exists in build.gradle config'
|
13
|
+
end
|
14
|
+
|
15
|
+
def description
|
16
|
+
'Validate that \android\ package not exists in Gradle project config (build.gradle file)'
|
17
|
+
end
|
18
|
+
|
19
|
+
def check(project)
|
20
|
+
gradle = project.android_folder.gradle
|
21
|
+
import_exist = File.readlines("#{gradle.path}/build.gradle").grep(/package android/).size.positive?
|
22
|
+
CheckReport.new(
|
23
|
+
name,
|
24
|
+
import_exist ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
25
|
+
description,
|
26
|
+
gradle.path
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Check Flutter plugin version in Gradle project config (build.gradle file)
|
32
|
+
class PluginGradleVersionCheck < Check
|
33
|
+
def name
|
34
|
+
'PluginGradleVersionCheck'
|
35
|
+
end
|
36
|
+
|
37
|
+
def summary
|
38
|
+
'Validate Flutter plugin\s version in build.gradle file'
|
39
|
+
end
|
40
|
+
|
41
|
+
def description
|
42
|
+
'Check plugin version in Gradle project config (build.gradle file)'
|
43
|
+
end
|
44
|
+
|
45
|
+
def check(project)
|
46
|
+
version_in_pubspec = project.pubspec.pubspec_info.version
|
47
|
+
gradle = project.android_folder.gradle
|
48
|
+
version_in_gradle = gradle.version
|
49
|
+
CheckReport.new(
|
50
|
+
name,
|
51
|
+
version_in_pubspec == version_in_gradle ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
52
|
+
description,
|
53
|
+
gradle.path
|
54
|
+
)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -1,109 +1,109 @@
|
|
1
|
-
require_relative 'check'
|
2
|
-
require_relative '../report/check_report'
|
3
|
-
|
4
|
-
module FlutterRb
|
5
|
-
# Base class for all info parameters in Flutter plugin podspec file
|
6
|
-
class PluginPodspecCheck < Check
|
7
|
-
def name
|
8
|
-
"PluginPodspec#{podspec_parameter.capitalize}Check"
|
9
|
-
end
|
10
|
-
|
11
|
-
def podspec_parameter
|
12
|
-
UNIMPLEMENTATION_ERROR
|
13
|
-
end
|
14
|
-
|
15
|
-
def summary
|
16
|
-
"Validate Flutter plugin's #{podspec_parameter} in podspec file"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
# Check Flutter plugin name in podspec file. Exists or not
|
21
|
-
class PluginPodspecNameCheck < PluginPodspecCheck
|
22
|
-
def podspec_parameter
|
23
|
-
'name'
|
24
|
-
end
|
25
|
-
|
26
|
-
def check(project)
|
27
|
-
name_in_pubspec = project.pubspec.pubspec_info.name
|
28
|
-
podspec = project.ios_folder.podspec
|
29
|
-
name_in_podspec = podspec.name
|
30
|
-
CheckReport.new(
|
31
|
-
name,
|
32
|
-
name_in_pubspec == name_in_podspec ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
33
|
-
description,
|
34
|
-
podspec.path
|
35
|
-
)
|
36
|
-
end
|
37
|
-
|
38
|
-
def description
|
39
|
-
'Check plugin name in podspec file'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# Check Flutter plugin version in podspec file. Exists or not
|
44
|
-
class PluginPodspecVersionCheck < PluginPodspecCheck
|
45
|
-
def podspec_parameter
|
46
|
-
'version'
|
47
|
-
end
|
48
|
-
|
49
|
-
def check(project)
|
50
|
-
version_in_pubspec = project.pubspec.pubspec_info.version
|
51
|
-
podspec = project.ios_folder.podspec
|
52
|
-
version_in_podspec = podspec.version
|
53
|
-
CheckReport.new(
|
54
|
-
name,
|
55
|
-
version_in_pubspec == version_in_podspec ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
56
|
-
description,
|
57
|
-
podspec.path
|
58
|
-
)
|
59
|
-
end
|
60
|
-
|
61
|
-
def description
|
62
|
-
'Check plugin version in podspec file'
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Check Flutter plugin's authors. Exists or not
|
67
|
-
class PluginPodspecAuthorsCheck < PluginPodspecCheck
|
68
|
-
def podspec_parameter
|
69
|
-
'authors'
|
70
|
-
end
|
71
|
-
|
72
|
-
def check(project)
|
73
|
-
podspec = project.ios_folder.podspec
|
74
|
-
author_exists = !podspec.authors.nil?
|
75
|
-
CheckReport.new(
|
76
|
-
name,
|
77
|
-
author_exists ? CheckReportStatus::NORMAL : CheckReportStatus::ERROR,
|
78
|
-
description,
|
79
|
-
podspec.path
|
80
|
-
)
|
81
|
-
end
|
82
|
-
|
83
|
-
def description
|
84
|
-
"Check plugin's authors in podspec file"
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
# Check plugin iOS source path in podspec file.
|
89
|
-
# If Flutter plugin cannot contains iOS specific code, source path must be '.'
|
90
|
-
class PluginPodspecSourceCheck < PluginPodspecCheck
|
91
|
-
def podspec_parameter
|
92
|
-
'source'
|
93
|
-
end
|
94
|
-
|
95
|
-
def check(project)
|
96
|
-
podspec = project.ios_folder.podspec
|
97
|
-
CheckReport.new(
|
98
|
-
name,
|
99
|
-
podspec.source.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
100
|
-
description,
|
101
|
-
podspec.path
|
102
|
-
)
|
103
|
-
end
|
104
|
-
|
105
|
-
def description
|
106
|
-
'Check plugin iOS source path in podspec file'
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
1
|
+
require_relative 'check'
|
2
|
+
require_relative '../report/check_report'
|
3
|
+
|
4
|
+
module FlutterRb
|
5
|
+
# Base class for all info parameters in Flutter plugin podspec file
|
6
|
+
class PluginPodspecCheck < Check
|
7
|
+
def name
|
8
|
+
"PluginPodspec#{podspec_parameter.capitalize}Check"
|
9
|
+
end
|
10
|
+
|
11
|
+
def podspec_parameter
|
12
|
+
UNIMPLEMENTATION_ERROR
|
13
|
+
end
|
14
|
+
|
15
|
+
def summary
|
16
|
+
"Validate Flutter plugin's #{podspec_parameter} in podspec file"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Check Flutter plugin name in podspec file. Exists or not
|
21
|
+
class PluginPodspecNameCheck < PluginPodspecCheck
|
22
|
+
def podspec_parameter
|
23
|
+
'name'
|
24
|
+
end
|
25
|
+
|
26
|
+
def check(project)
|
27
|
+
name_in_pubspec = project.pubspec.pubspec_info.name
|
28
|
+
podspec = project.ios_folder.podspec
|
29
|
+
name_in_podspec = podspec.name
|
30
|
+
CheckReport.new(
|
31
|
+
name,
|
32
|
+
name_in_pubspec == name_in_podspec ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
33
|
+
description,
|
34
|
+
podspec.path
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
def description
|
39
|
+
'Check plugin name in podspec file'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Check Flutter plugin version in podspec file. Exists or not
|
44
|
+
class PluginPodspecVersionCheck < PluginPodspecCheck
|
45
|
+
def podspec_parameter
|
46
|
+
'version'
|
47
|
+
end
|
48
|
+
|
49
|
+
def check(project)
|
50
|
+
version_in_pubspec = project.pubspec.pubspec_info.version
|
51
|
+
podspec = project.ios_folder.podspec
|
52
|
+
version_in_podspec = podspec.version
|
53
|
+
CheckReport.new(
|
54
|
+
name,
|
55
|
+
version_in_pubspec == version_in_podspec ? CheckReportStatus::NORMAL : CheckReportStatus::WARNING,
|
56
|
+
description,
|
57
|
+
podspec.path
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def description
|
62
|
+
'Check plugin version in podspec file'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Check Flutter plugin's authors. Exists or not
|
67
|
+
class PluginPodspecAuthorsCheck < PluginPodspecCheck
|
68
|
+
def podspec_parameter
|
69
|
+
'authors'
|
70
|
+
end
|
71
|
+
|
72
|
+
def check(project)
|
73
|
+
podspec = project.ios_folder.podspec
|
74
|
+
author_exists = !podspec.authors.nil?
|
75
|
+
CheckReport.new(
|
76
|
+
name,
|
77
|
+
author_exists ? CheckReportStatus::NORMAL : CheckReportStatus::ERROR,
|
78
|
+
description,
|
79
|
+
podspec.path
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def description
|
84
|
+
"Check plugin's authors in podspec file"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check plugin iOS source path in podspec file.
|
89
|
+
# If Flutter plugin cannot contains iOS specific code, source path must be '.'
|
90
|
+
class PluginPodspecSourceCheck < PluginPodspecCheck
|
91
|
+
def podspec_parameter
|
92
|
+
'source'
|
93
|
+
end
|
94
|
+
|
95
|
+
def check(project)
|
96
|
+
podspec = project.ios_folder.podspec
|
97
|
+
CheckReport.new(
|
98
|
+
name,
|
99
|
+
podspec.source.nil? ? CheckReportStatus::ERROR : CheckReportStatus::NORMAL,
|
100
|
+
description,
|
101
|
+
podspec.path
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
def description
|
106
|
+
'Check plugin iOS source path in podspec file'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|