|
1 | 1 | part of flutter_automation; |
2 | 2 |
|
3 | 3 | class _Commons { |
4 | | - static final String scriptRoot = |
5 | | - path.dirname(Platform.script.toFilePath()) + "${path.separator}.."; |
6 | 4 | static final String basePath = "./lib"; |
7 | 5 | static final String pubspecPath = './pubspec.yaml'; |
8 | 6 | static final String stringsPath = |
9 | 7 | "./android/app/src/main/res/values/strings.xml"; |
10 | 8 | static final String manifestPath = |
11 | 9 | "./android/app/src/main/AndroidManifest.xml"; |
12 | 10 | static final String appBuildPath = "./android/app/build.gradle"; |
13 | | - static final String projectBuildPath = "./android/build.gradle"; |
14 | 11 |
|
15 | 12 | /// Default plugin versions |
16 | 13 | static Map<String, dynamic> defaultConfig = { |
@@ -68,41 +65,4 @@ class _Commons { |
68 | 65 | static List<String> getFileAsLines(String path) { |
69 | 66 | return File(path).readAsLinesSync(); |
70 | 67 | } |
71 | | - |
72 | | - /// Copies files recursively from [from] directory to [to] directory |
73 | | - static void copyFilesRecursive(String from, String to, |
74 | | - {String renameBaseDir}) { |
75 | | - Process.run( |
76 | | - "cp", |
77 | | - ["-r", from, to], |
78 | | - ).then((res) { |
79 | | - stdout.write(res.stdout); |
80 | | - if (res.stderr.toString().isNotEmpty) { |
81 | | - stderr.write(res.stderr); |
82 | | - } else { |
83 | | - if (renameBaseDir != null) { |
84 | | - renameStockFiles(renameBaseDir); |
85 | | - } |
86 | | - stdout.writeln("copied stock files"); |
87 | | - } |
88 | | - }); |
89 | | - } |
90 | | - |
91 | | - /// Renames all stock files in [basedir] |
92 | | - static void renameStockFiles(String basedir) { |
93 | | - Directory dir = Directory(basedir); |
94 | | - List<FileSystemEntity> files = dir.listSync(recursive: true); |
95 | | - files.forEach((file) { |
96 | | - if (file is File) { |
97 | | - String filename = path.basename(file.path); |
98 | | - if (filename.substring(filename.length - 5, filename.length) == |
99 | | - ".temp") { |
100 | | - String newFilename = filename.substring(0, filename.length - 5); |
101 | | - file.renameSync( |
102 | | - path.dirname(file.path) + path.separator + newFilename); |
103 | | - } |
104 | | - } |
105 | | - }); |
106 | | - stdout.writeln("renamed stock files"); |
107 | | - } |
108 | 68 | } |
0 commit comments