mirror of
https://github.com/flutter/packages.git
synced 2025-06-29 22:33:11 +08:00
update dockerfile to fix gpg & flutter format (#130)
This commit is contained in:

committed by
GitHub

parent
2917af6c53
commit
c9c42d5089
@ -1,5 +1,18 @@
|
||||
# Last updated 4/8/2020 (to rebuild the docker image, update this timestamp)
|
||||
FROM cirrusci/flutter:latest
|
||||
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt-get upgrade --yes && \
|
||||
sudo apt-get install --yes gpg-agent && \
|
||||
sudo apt-get clean --yes
|
||||
|
||||
# This must occur after the install of gpg-agent
|
||||
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && \
|
||||
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" && \
|
||||
sudo apt-get update && \
|
||||
sudo apt-get install --yes --allow-unauthenticated clang-format-5.0 && \
|
||||
sudo apt-get clean --yes
|
||||
|
||||
RUN yes | sdkmanager \
|
||||
"platforms;android-27" \
|
||||
"build-tools;27.0.3" \
|
||||
|
@ -18,11 +18,6 @@ task:
|
||||
depends_on:
|
||||
- analyze
|
||||
- name: test+format
|
||||
install_script:
|
||||
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
- sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install -y --allow-unauthenticated clang-format-5.0
|
||||
format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-5.0
|
||||
test_script: ./script/incremental_build.sh test
|
||||
depends_on:
|
||||
|
@ -23,8 +23,7 @@ void _writeHostApi(Indent indent, Api api) {
|
||||
indent.dec();
|
||||
indent.dec();
|
||||
indent.writeln('');
|
||||
final String returnStatement =
|
||||
func.returnType == 'void'
|
||||
final String returnStatement = func.returnType == 'void'
|
||||
? '// noop'
|
||||
: 'return ${func.returnType}._fromMap(replyMap[\'${Keys.result}\']);';
|
||||
indent.format('''Map replyMap = await channel.send(requestMap);
|
||||
|
@ -127,7 +127,8 @@ void generateObjcHeader(ObjcOptions options, Root root, StringSink sink) {
|
||||
for (Method func in api.methods) {
|
||||
final String returnType = _className(options.prefix, func.returnType);
|
||||
final String argType = _className(options.prefix, func.argType);
|
||||
final String callbackType = _callbackForType(func.returnType, returnType);
|
||||
final String callbackType =
|
||||
_callbackForType(func.returnType, returnType);
|
||||
indent.writeln(
|
||||
'- (void)${func.name}:($argType*)input completion:($callbackType)completion;');
|
||||
}
|
||||
|
@ -9,8 +9,10 @@ import 'dart:typed_data';
|
||||
import 'package:bsdiff/bsdiff.dart';
|
||||
|
||||
void main() {
|
||||
final Uint8List originalData = Uint8List.fromList(List<int>.generate(1000, (int index) => index));
|
||||
final Uint8List modifiedData = Uint8List.fromList(List<int>.generate(2000, (int index) => 2 * index));
|
||||
final Uint8List originalData =
|
||||
Uint8List.fromList(List<int>.generate(1000, (int index) => index));
|
||||
final Uint8List modifiedData =
|
||||
Uint8List.fromList(List<int>.generate(2000, (int index) => 2 * index));
|
||||
|
||||
print('Original data size ${originalData.length} bytes');
|
||||
print('Modified data size ${modifiedData.length} bytes');
|
||||
|
35
third_party/packages/bsdiff/lib/bsdiff.dart
vendored
35
third_party/packages/bsdiff/lib/bsdiff.dart
vendored
@ -183,7 +183,6 @@ class _Ref<T> {
|
||||
|
||||
int _search(List<int> idata, Uint8List olddata, Uint8List newdata, int newskip,
|
||||
int start, int end, _Ref<int> pos) {
|
||||
|
||||
if (end - start < 2) {
|
||||
final int x = _matchlen(olddata, idata[start], newdata, newskip);
|
||||
final int y = _matchlen(olddata, idata[end], newdata, newskip);
|
||||
@ -205,7 +204,8 @@ int _search(List<int> idata, Uint8List olddata, Uint8List newdata, int newskip,
|
||||
}
|
||||
}
|
||||
|
||||
List<int> _int64bytes(int i) => (ByteData(8)..setInt64(0, i)).buffer.asUint8List();
|
||||
List<int> _int64bytes(int i) =>
|
||||
(ByteData(8)..setInt64(0, i)).buffer.asUint8List();
|
||||
|
||||
Uint8List bsdiff(List<int> olddata, List<int> newdata) {
|
||||
final int oldsize = olddata.length;
|
||||
@ -223,21 +223,24 @@ Uint8List bsdiff(List<int> olddata, List<int> newdata) {
|
||||
BytesBuilder buf = BytesBuilder();
|
||||
final _Ref<int> pos = _Ref<int>();
|
||||
|
||||
for (int scan = 0, len = 0, lastscan = 0, lastpos = 0, lastoffset = 0; scan < newsize; ) {
|
||||
for (int scan = 0, len = 0, lastscan = 0, lastpos = 0, lastoffset = 0;
|
||||
scan < newsize;) {
|
||||
int oldscore = 0;
|
||||
|
||||
for (int scsc = scan += len; scan < newsize; scan++) {
|
||||
len = _search(idata, olddata, newdata, scan, 0, oldsize, pos);
|
||||
|
||||
for (; scsc < scan + len; scsc++) {
|
||||
if ((scsc + lastoffset < oldsize) && (olddata[scsc + lastoffset] == newdata[scsc])) {
|
||||
if ((scsc + lastoffset < oldsize) &&
|
||||
(olddata[scsc + lastoffset] == newdata[scsc])) {
|
||||
oldscore++;
|
||||
}
|
||||
}
|
||||
if (((len == oldscore) && (len != 0)) || (len > oldscore + 8)) {
|
||||
break;
|
||||
}
|
||||
if ((scan + lastoffset < oldsize) && (olddata[scan + lastoffset] == newdata[scan])) {
|
||||
if ((scan + lastoffset < oldsize) &&
|
||||
(olddata[scan + lastoffset] == newdata[scan])) {
|
||||
oldscore--;
|
||||
}
|
||||
}
|
||||
@ -246,7 +249,8 @@ Uint8List bsdiff(List<int> olddata, List<int> newdata) {
|
||||
int lenf = 0;
|
||||
int lenb = 0;
|
||||
|
||||
for (int sf = 0, s = 0, i = 0; (lastscan + i < scan) && (lastpos + i < oldsize); ) {
|
||||
for (int sf = 0, s = 0, i = 0;
|
||||
(lastscan + i < scan) && (lastpos + i < oldsize);) {
|
||||
if (olddata[lastpos + i] == newdata[lastscan + i]) {
|
||||
s++;
|
||||
}
|
||||
@ -258,7 +262,9 @@ Uint8List bsdiff(List<int> olddata, List<int> newdata) {
|
||||
}
|
||||
|
||||
if (scan < newsize) {
|
||||
for (int sb = 0, s = 0, i = 1; (scan >= lastscan + i) && (pos.value >= i); i++) {
|
||||
for (int sb = 0, s = 0, i = 1;
|
||||
(scan >= lastscan + i) && (pos.value >= i);
|
||||
i++) {
|
||||
if (olddata[pos.value - i] == newdata[scan - i]) {
|
||||
s++;
|
||||
}
|
||||
@ -273,7 +279,8 @@ Uint8List bsdiff(List<int> olddata, List<int> newdata) {
|
||||
final int overlap = (lastscan + lenf) - (scan - lenb);
|
||||
int lens = 0;
|
||||
for (int ss = 0, s = 0, i = 0; i < overlap; i++) {
|
||||
if (newdata[lastscan + lenf - overlap + i] == olddata[lastpos + lenf - overlap + i]) {
|
||||
if (newdata[lastscan + lenf - overlap + i] ==
|
||||
olddata[lastpos + lenf - overlap + i]) {
|
||||
s++;
|
||||
}
|
||||
if (newdata[scan - lenb + i] == olddata[pos.value - lenb + i]) {
|
||||
@ -345,15 +352,19 @@ Uint8List bspatch(List<int> olddata, List<int> diffdata) {
|
||||
throw Exception('Invalid magic');
|
||||
}
|
||||
|
||||
final ByteData header = ByteData.view(Uint8List.fromList(diffdata.sublist(0, 32)).buffer);
|
||||
final ByteData header =
|
||||
ByteData.view(Uint8List.fromList(diffdata.sublist(0, 32)).buffer);
|
||||
|
||||
final int ctrllen = header.getInt64(8);
|
||||
final int datalen = header.getInt64(16);
|
||||
final int newsize = header.getInt64(24);
|
||||
|
||||
final List<int> cpf = gzip.decoder.convert(diffdata.sublist(32, 32+ctrllen));
|
||||
final List<int> dpf = gzip.decoder.convert(diffdata.sublist(32+ctrllen, 32+ctrllen+datalen));
|
||||
final List<int> epf = gzip.decoder.convert(diffdata.sublist(32+ctrllen+datalen, diffdata.length));
|
||||
final List<int> cpf =
|
||||
gzip.decoder.convert(diffdata.sublist(32, 32 + ctrllen));
|
||||
final List<int> dpf = gzip.decoder
|
||||
.convert(diffdata.sublist(32 + ctrllen, 32 + ctrllen + datalen));
|
||||
final List<int> epf = gzip.decoder
|
||||
.convert(diffdata.sublist(32 + ctrllen + datalen, diffdata.length));
|
||||
|
||||
final ByteData cpfdata = ByteData.view(Uint8List.fromList(cpf).buffer);
|
||||
|
||||
|
Reference in New Issue
Block a user