Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
bc70ae0f
Unverified
Commit
bc70ae0f
authored
Oct 17, 2022
by
Casey Hillers
Committed by
GitHub
Oct 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[packaging] Remove dev references (#113462)
parent
e5c8614e
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
77 deletions
+64
-77
prepare_package.dart
dev/bots/prepare_package.dart
+20
-33
prepare_package_test.dart
dev/bots/test/prepare_package_test.dart
+44
-44
No files found.
dev/bots/prepare_package.dart
View file @
bc70ae0f
...
...
@@ -52,29 +52,19 @@ class PreparePackageException implements Exception {
}
}
enum
Branch
{
dev
,
beta
,
stable
}
enum
Branch
{
beta
,
stable
;
String
getBranchName
(
Branch
branch
)
{
switch
(
branch
)
{
case
Branch
.
beta
:
return
'beta'
;
case
Branch
.
dev
:
return
'dev'
;
case
Branch
.
stable
:
return
'stable'
;
}
}
Branch
fromBranchName
(
String
name
)
{
switch
(
name
)
{
case
'beta'
:
return
Branch
.
beta
;
case
'dev'
:
return
Branch
.
dev
;
case
'stable'
:
return
Branch
.
stable
;
default
:
throw
ArgumentError
(
'Invalid branch name.'
);
static
Branch
fromName
(
String
name
)
{
switch
(
name
)
{
case
'beta'
:
return
Branch
.
beta
;
case
'stable'
:
return
Branch
.
stable
;
default
:
throw
ArgumentError
(
'Invalid branch name.'
);
}
}
}
...
...
@@ -304,9 +294,6 @@ class ArchiveCreator {
.
trim
().
split
(
' '
).
last
.
replaceAll
(
'"'
,
''
).
split
(
'_'
)[
1
];
})();
/// Get the name of the channel as a string.
String
get
branchName
=>
getBranchName
(
branch
);
/// Returns a default archive name when given a Git revision.
/// Used when an output filename is not given.
Future
<
String
>
get
_archiveName
async
{
...
...
@@ -321,7 +308,8 @@ class ArchiveCreator {
// unpacking it!) So, we use .zip for Mac, and the files are about
// 220MB larger than they need to be. :-(
final
String
suffix
=
platform
.
isLinux
?
'tar.xz'
:
'zip'
;
return
'flutter_
${os}
_
$arch${_version[frameworkVersionTag]}
-
$branchName
.
$suffix
'
;
final
String
package
=
'
${os}
_
$arch${_version[frameworkVersionTag]}
'
;
return
'flutter_
$package
-
${branch.name}
.
$suffix
'
;
}
/// Checks out the flutter repo and prepares it for other operations.
...
...
@@ -425,7 +413,7 @@ class ArchiveCreator {
// We want the user to start out the in the specified branch instead of a
// detached head. To do that, we need to make sure the branch points at the
// desired revision.
await
_runGit
(<
String
>[
'clone'
,
'-b'
,
branch
N
ame
,
gobMirror
],
workingDirectory:
tempDir
);
await
_runGit
(<
String
>[
'clone'
,
'-b'
,
branch
.
n
ame
,
gobMirror
],
workingDirectory:
tempDir
);
await
_runGit
(<
String
>[
'reset'
,
'--hard'
,
revision
]);
// Make the origin point to github instead of the chromium mirror.
...
...
@@ -624,8 +612,7 @@ class ArchivePublisher {
final
File
outputFile
;
final
ProcessRunner
_processRunner
;
final
bool
dryRun
;
String
get
branchName
=>
getBranchName
(
branch
);
String
get
destinationArchivePath
=>
'
$branchName
/
$platformName
/
${path.basename(outputFile.path)}
'
;
String
get
destinationArchivePath
=>
'
${branch.name}
/
$platformName
/
${path.basename(outputFile.path)}
'
;
static
String
getMetadataFilename
(
Platform
platform
)
=>
'releases_
${platform.operatingSystem.toLowerCase()}
.json'
;
Future
<
String
>
_getChecksum
(
File
archiveFile
)
async
{
...
...
@@ -666,14 +653,14 @@ class ArchivePublisher {
if
(!
jsonData
.
containsKey
(
'current_release'
))
{
jsonData
[
'current_release'
]
=
<
String
,
String
>{};
}
(
jsonData
[
'current_release'
]
as
Map
<
String
,
dynamic
>)[
branch
N
ame
]
=
revision
;
(
jsonData
[
'current_release'
]
as
Map
<
String
,
dynamic
>)[
branch
.
n
ame
]
=
revision
;
if
(!
jsonData
.
containsKey
(
'releases'
))
{
jsonData
[
'releases'
]
=
<
Map
<
String
,
dynamic
>>[];
}
final
Map
<
String
,
dynamic
>
newEntry
=
<
String
,
dynamic
>{};
newEntry
[
'hash'
]
=
revision
;
newEntry
[
'channel'
]
=
branch
N
ame
;
newEntry
[
'channel'
]
=
branch
.
n
ame
;
newEntry
[
'version'
]
=
version
[
frameworkVersionTag
];
newEntry
[
'dart_sdk_version'
]
=
version
[
dartVersionTag
];
newEntry
[
'dart_sdk_arch'
]
=
version
[
dartTargetArchTag
];
...
...
@@ -825,7 +812,7 @@ Future<void> main(List<String> rawArguments) async {
'archive with. Must be the full 40-character hash. Required.'
);
argParser
.
addOption
(
'branch'
,
allowed:
Branch
.
values
.
map
<
String
>((
Branch
branch
)
=>
getBranchName
(
branch
)
),
allowed:
Branch
.
values
.
map
<
String
>((
Branch
branch
)
=>
branch
.
name
),
help:
'The Flutter branch to build the archive with. Required.'
,
);
argParser
.
addOption
(
...
...
@@ -907,7 +894,7 @@ Future<void> main(List<String> rawArguments) async {
final
bool
publish
=
parsedArguments
[
'publish'
]
as
bool
;
final
bool
dryRun
=
parsedArguments
[
'dry_run'
]
as
bool
;
final
Branch
branch
=
fromBranch
Name
(
parsedArguments
[
'branch'
]
as
String
);
final
Branch
branch
=
Branch
.
from
Name
(
parsedArguments
[
'branch'
]
as
String
);
final
ArchiveCreator
creator
=
ArchiveCreator
(
tempDir
,
outputDir
,
...
...
dev/bots/test/prepare_package_test.dart
View file @
bc70ae0f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment