Unverified Commit 512ea8f9 authored by Zachary Anderson's avatar Zachary Anderson Committed by GitHub

[flutter_tools] Remove reference to pm genkey and -k (#79047)

parent f05c409a
...@@ -185,7 +185,6 @@ Future<void> _buildPackage( ...@@ -185,7 +185,6 @@ Future<void> _buildPackage(
final String appName = fuchsiaProject.project.manifest.appName; final String appName = fuchsiaProject.project.manifest.appName;
final String pkgassets = globals.fs.path.join(outDir, '${appName}_pkgassets'); final String pkgassets = globals.fs.path.join(outDir, '${appName}_pkgassets');
final String packageManifest = globals.fs.path.join(pkgDir, 'package_manifest'); final String packageManifest = globals.fs.path.join(pkgDir, 'package_manifest');
final String devKeyPath = globals.fs.path.join(pkgDir, 'development.key');
final Directory pkg = globals.fs.directory(pkgDir); final Directory pkg = globals.fs.directory(pkgDir);
if (!pkg.existsSync()) { if (!pkg.existsSync()) {
...@@ -219,13 +218,10 @@ Future<void> _buildPackage( ...@@ -219,13 +218,10 @@ Future<void> _buildPackage(
if (!await fuchsiaPM.init(pkgDir, appName)) { if (!await fuchsiaPM.init(pkgDir, appName)) {
return; return;
} }
if (!await fuchsiaPM.genkey(pkgDir, devKeyPath)) { if (!await fuchsiaPM.build(pkgDir, packageManifest)) {
return; return;
} }
if (!await fuchsiaPM.build(pkgDir, devKeyPath, packageManifest)) { if (!await fuchsiaPM.archive(pkgDir, packageManifest)) {
return;
}
if (!await fuchsiaPM.archive(pkgDir, devKeyPath, packageManifest)) {
return; return;
} }
} }
...@@ -33,19 +33,6 @@ class FuchsiaPM { ...@@ -33,19 +33,6 @@ class FuchsiaPM {
]); ]);
} }
/// Generates a new private key to be used to sign a Fuchsia package.
///
/// [buildPath] should be the same [buildPath] passed to [init].
Future<bool> genkey(String buildPath, String outKeyPath) {
return _runPMCommand(<String>[
'-o',
buildPath,
'-k',
outKeyPath,
'genkey',
]);
}
/// Updates, signs, and seals a Fuchsia package. /// Updates, signs, and seals a Fuchsia package.
/// ///
/// [buildPath] should be the same [buildPath] passed to [init]. /// [buildPath] should be the same [buildPath] passed to [init].
...@@ -61,12 +48,10 @@ class FuchsiaPM { ...@@ -61,12 +48,10 @@ class FuchsiaPM {
/// ///
/// where $APPNAME is the same [appName] passed to [init], and meta/package /// where $APPNAME is the same [appName] passed to [init], and meta/package
/// is set up to be the file `meta/package` created by [init]. /// is set up to be the file `meta/package` created by [init].
Future<bool> build(String buildPath, String keyPath, String manifestPath) { Future<bool> build(String buildPath, String manifestPath) {
return _runPMCommand(<String>[ return _runPMCommand(<String>[
'-o', '-o',
buildPath, buildPath,
'-k',
keyPath,
'-m', '-m',
manifestPath, manifestPath,
'build', 'build',
...@@ -80,12 +65,10 @@ class FuchsiaPM { ...@@ -80,12 +65,10 @@ class FuchsiaPM {
/// ///
/// [buildPath] should be the same path passed to [init], and [manifestPath] /// [buildPath] should be the same path passed to [init], and [manifestPath]
/// should be the same manifest passed to [build]. /// should be the same manifest passed to [build].
Future<bool> archive(String buildPath, String keyPath, String manifestPath) { Future<bool> archive(String buildPath, String manifestPath) {
return _runPMCommand(<String>[ return _runPMCommand(<String>[
'-o', '-o',
buildPath, buildPath,
'-k',
keyPath,
'-m', '-m',
manifestPath, manifestPath,
'archive', 'archive',
......
...@@ -189,18 +189,8 @@ class FakeFuchsiaPM extends Fake implements FuchsiaPM { ...@@ -189,18 +189,8 @@ class FakeFuchsiaPM extends Fake implements FuchsiaPM {
} }
@override @override
Future<bool> genkey(String buildPath, String outKeyPath) async { Future<bool> build(String buildPath, String manifestPath) async {
if (!fileSystem.file(fileSystem.path.join(buildPath, 'meta', 'package')).existsSync()) {
return false;
}
fileSystem.file(outKeyPath).createSync(recursive: true);
return true;
}
@override
Future<bool> build(String buildPath, String keyPath, String manifestPath) async {
if (!fileSystem.file(fileSystem.path.join(buildPath, 'meta', 'package')).existsSync() || if (!fileSystem.file(fileSystem.path.join(buildPath, 'meta', 'package')).existsSync() ||
!fileSystem.file(keyPath).existsSync() ||
!fileSystem.file(manifestPath).existsSync()) { !fileSystem.file(manifestPath).existsSync()) {
return false; return false;
} }
...@@ -209,9 +199,8 @@ class FakeFuchsiaPM extends Fake implements FuchsiaPM { ...@@ -209,9 +199,8 @@ class FakeFuchsiaPM extends Fake implements FuchsiaPM {
} }
@override @override
Future<bool> archive(String buildPath, String keyPath, String manifestPath) async { Future<bool> archive(String buildPath, String manifestPath) async {
if (!fileSystem.file(fileSystem.path.join(buildPath, 'meta', 'package')).existsSync() || if (!fileSystem.file(fileSystem.path.join(buildPath, 'meta', 'package')).existsSync() ||
!fileSystem.file(keyPath).existsSync() ||
!fileSystem.file(manifestPath).existsSync()) { !fileSystem.file(manifestPath).existsSync()) {
return false; return false;
} }
......
...@@ -1523,18 +1523,8 @@ class FakeFuchsiaPM implements FuchsiaPM { ...@@ -1523,18 +1523,8 @@ class FakeFuchsiaPM implements FuchsiaPM {
} }
@override @override
Future<bool> genkey(String buildPath, String outKeyPath) async { Future<bool> build(String buildPath, String manifestPath) async {
if (!globals.fs.file(globals.fs.path.join(buildPath, 'meta', 'package')).existsSync()) {
return false;
}
globals.fs.file(outKeyPath).createSync(recursive: true);
return true;
}
@override
Future<bool> build(String buildPath, String keyPath, String manifestPath) async {
if (!globals.fs.file(globals.fs.path.join(buildPath, 'meta', 'package')).existsSync() || if (!globals.fs.file(globals.fs.path.join(buildPath, 'meta', 'package')).existsSync() ||
!globals.fs.file(keyPath).existsSync() ||
!globals.fs.file(manifestPath).existsSync()) { !globals.fs.file(manifestPath).existsSync()) {
return false; return false;
} }
...@@ -1543,9 +1533,8 @@ class FakeFuchsiaPM implements FuchsiaPM { ...@@ -1543,9 +1533,8 @@ class FakeFuchsiaPM implements FuchsiaPM {
} }
@override @override
Future<bool> archive(String buildPath, String keyPath, String manifestPath) async { Future<bool> archive(String buildPath, String manifestPath) async {
if (!globals.fs.file(globals.fs.path.join(buildPath, 'meta', 'package')).existsSync() || if (!globals.fs.file(globals.fs.path.join(buildPath, 'meta', 'package')).existsSync() ||
!globals.fs.file(keyPath).existsSync() ||
!globals.fs.file(manifestPath).existsSync()) { !globals.fs.file(manifestPath).existsSync()) {
return false; return false;
} }
...@@ -1589,18 +1578,14 @@ class FailingPM implements FuchsiaPM { ...@@ -1589,18 +1578,14 @@ class FailingPM implements FuchsiaPM {
return false; return false;
} }
@override
Future<bool> genkey(String buildPath, String outKeyPath) async {
return false;
}
@override @override
Future<bool> build(String buildPath, String keyPath, String manifestPath) async { Future<bool> build(String buildPath, String manifestPath) async {
return false; return false;
} }
@override @override
Future<bool> archive(String buildPath, String keyPath, String manifestPath) async { Future<bool> archive(String buildPath, String manifestPath) async {
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment