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
38215608
Commit
38215608
authored
Nov 29, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #611 from abarth/rm_build_sky_apk
Remove build_sky_apk.dart
parents
8f7e6204
c477b125
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
126 deletions
+0
-126
build_sky_apk.dart
packages/flutter_tools/bin/build_sky_apk.dart
+0
-126
No files found.
packages/flutter_tools/bin/build_sky_apk.dart
deleted
100644 → 0
View file @
8f7e6204
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:io'
;
import
'package:args/args.dart'
;
const
String
kBuildToolsVersion
=
'22.0.1'
;
const
String
kAndroidPlatformVersion
=
'22'
;
const
String
kKeystoreKeyName
=
"chromiumdebugkey"
;
const
String
kKeystorePassword
=
"chromium"
;
class
AssetBuilder
{
final
Directory
outDir
;
Directory
_assetDir
;
AssetBuilder
(
this
.
outDir
)
{
_assetDir
=
new
Directory
(
'
${outDir.path}
/assets'
);
_assetDir
.
createSync
(
recursive:
true
);
}
void
add
(
File
asset
,
String
assetName
)
{
asset
.
copySync
(
'
${_assetDir.path}
/
$assetName
'
);
}
Directory
get
directory
=>
_assetDir
;
}
class
ApkBuilder
{
final
String
androidSDK
;
File
_androidJar
;
File
_aapt
;
File
_zipalign
;
String
_jarsigner
;
ApkBuilder
(
this
.
androidSDK
)
{
_androidJar
=
new
File
(
'
$androidSDK
/platforms/android-
$kAndroidPlatformVersion
/android.jar'
);
String
buildTools
=
'
$androidSDK
/build-tools/
$kBuildToolsVersion
'
;
_aapt
=
new
File
(
'
$buildTools
/aapt'
);
_zipalign
=
new
File
(
'
$buildTools
/zipalign'
);
_jarsigner
=
'jarsigner'
;
}
void
package
(
File
androidManifest
,
Directory
assets
,
File
outputApk
)
{
_run
(
_aapt
.
path
,
[
'package'
,
'-M'
,
androidManifest
.
path
,
'-A'
,
assets
.
path
,
'-I'
,
_androidJar
.
path
,
'-F'
,
outputApk
.
path
,
]);
}
void
add
(
Directory
base
,
String
resource
,
File
outputApk
)
{
_run
(
_aapt
.
path
,
[
'add'
,
'-f'
,
outputApk
.
absolute
.
path
,
resource
,
],
workingDirectory:
base
.
path
);
}
void
sign
(
File
keystore
,
String
keystorePassword
,
String
keyName
,
File
outputApk
)
{
_run
(
_jarsigner
,
[
'-keystore'
,
keystore
.
path
,
'-storepass'
,
keystorePassword
,
outputApk
.
path
,
keyName
,
]);
}
void
align
(
File
unalignedApk
,
File
outputApk
)
{
_run
(
_zipalign
.
path
,
[
'4'
,
unalignedApk
.
path
,
outputApk
.
path
]);
}
void
_run
(
String
command
,
List
<
String
>
args
,
{
String
workingDirectory
})
{
ProcessResult
result
=
Process
.
runSync
(
command
,
args
,
workingDirectory:
workingDirectory
);
if
(
result
.
exitCode
==
0
)
return
;
stdout
.
write
(
result
.
stdout
);
stderr
.
write
(
result
.
stderr
);
}
}
main
(
List
<
String
>
argv
)
async
{
ArgParser
parser
=
new
ArgParser
();
parser
.
addFlag
(
'help'
,
abbr:
'h'
,
negatable:
false
);
parser
.
addOption
(
'android-sdk'
);
parser
.
addOption
(
'skyx'
);
ArgResults
args
=
parser
.
parse
(
argv
);
if
(
args
[
'help'
])
{
print
(
'usage: build_sky_apk <options>'
);
print
(
''
);
print
(
parser
.
usage
);
return
;
}
Directory
artifacts
=
new
Directory
(
'artifacts'
);
File
keystore
=
new
File
(
'
${artifacts.path}
/chromium-debug.keystore'
);
File
androidManifest
=
new
File
(
'
${artifacts.path}
/AndroidManifest.xml'
);
File
icuData
=
new
File
(
'
${artifacts.path}
/assets/icudtl.dat'
);
File
appSkyx
=
new
File
(
args
[
'skyx'
]);
Directory
outDir
=
new
Directory
(
'out'
);
outDir
.
createSync
(
recursive:
true
);
AssetBuilder
assetBuilder
=
new
AssetBuilder
(
outDir
);
assetBuilder
.
add
(
icuData
,
'icudtl.dat'
);
assetBuilder
.
add
(
appSkyx
,
'app.skyx'
);
ApkBuilder
builder
=
new
ApkBuilder
(
args
[
'android-sdk'
]);
File
unalignedApk
=
new
File
(
'
${outDir.path}
/Example.apk.unaligned'
);
File
finalApk
=
new
File
(
'
${outDir.path}
/Example.apk'
);
builder
.
package
(
androidManifest
,
assetBuilder
.
directory
,
unalignedApk
);
builder
.
add
(
artifacts
,
'classes.dex'
,
unalignedApk
);
builder
.
add
(
artifacts
,
'lib/armeabi-v7a/libsky_shell.so'
,
unalignedApk
);
builder
.
sign
(
keystore
,
kKeystorePassword
,
kKeystoreKeyName
,
unalignedApk
);
builder
.
align
(
unalignedApk
,
finalApk
);
}
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