Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
7e48cfa4
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7e48cfa4
编写于
5月 28, 2018
作者:
A
Adam Barth
提交者:
GitHub
5月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve license script (#5382)
上级
3032cf82
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
101 addition
and
33 deletion
+101
-33
tools/licenses/lib/licenses.dart
tools/licenses/lib/licenses.dart
+2
-0
tools/licenses/lib/main.dart
tools/licenses/lib/main.dart
+99
-33
未找到文件。
tools/licenses/lib/licenses.dart
浏览文件 @
7e48cfa4
...
...
@@ -53,6 +53,7 @@ LicenseType convertLicenseNameToType(String name) {
case
'license.html'
:
case
'LICENSE.txt'
:
case
'LICENSE.TXT'
:
case
'LICENSE.cssmin'
:
case
'NOTICE'
:
case
'NOTICE.txt'
:
case
'Copyright'
:
...
...
@@ -68,6 +69,7 @@ LicenseType convertLicenseNameToType(String name) {
case
'libyaml-license.txt'
:
case
'license.patch'
:
case
'license.rst'
:
case
'LICENSE.rst'
:
case
'mh-bsd-gcc'
:
case
'pivotal.labs.license.txt'
:
return
LicenseType
.
unknown
;
...
...
tools/licenses/lib/main.dart
浏览文件 @
7e48cfa4
...
...
@@ -357,37 +357,68 @@ class RepositoryBlankLicenseFile extends RepositorySingleLicenseFile {
License
licenseOfType
(
LicenseType
type
)
=>
null
;
}
class
Repository
OkHttp
LicenseFile
extends
RepositorySingleLicenseFile
{
Repository
OkHttp
LicenseFile
(
RepositoryDirectory
parent
,
fs
.
TextFile
io
)
class
Repository
CatapultApiClient
LicenseFile
extends
RepositorySingleLicenseFile
{
Repository
CatapultApiClient
LicenseFile
(
RepositoryDirectory
parent
,
fs
.
TextFile
io
)
:
super
(
parent
,
io
,
_parseLicense
(
io
));
static
final
RegExp
_pattern
=
new
RegExp
(
r'
^((?:.|\n)*)
\n'
r'
Licensed under the Apache License, Version 2\.0 \(the "License"\);
\n'
r'
you may not use this file except in compliance with the License\.
\n'
r'
You may obtain a copy of the License at
\n'
r'\n'
r'
(http://www\.apache\.org/licenses/LICENSE-2\.0)
\n'
r'\n'
r'
Unless required by applicable law or agreed to in writing, software
\n'
r'
distributed under the License is distributed on an "AS IS" BASIS,
\n'
r'
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
\n'
r'
See the License for the specific language governing permissions and\n'
r'limitations under the License\.\n*$'
,
caseSensitive:
false
r'
*Licensed under the Apache License, Version 2\.0 \(the "License"\);
\n'
r'
*you may not use this file except in compliance with the License\.
\n'
r'
*You may obtain a copy of the License at
\n'
r'
*
\n'
r'
*(http://www\.apache\.org/licenses/LICENSE-2\.0)
\n'
r'
*
\n'
r'
*Unless required by applicable law or agreed to in writing, software
\n'
r'
*distributed under the License is distributed on an "AS IS" BASIS,
\n'
r'
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
\n'
r'
*See the License for the specific language governing permissions and
\n'
r'
*limitations under the License\.\n'
,
multiLine:
true
,
caseSensitive:
false
,
);
static
License
_parseLicense
(
fs
.
TextFile
io
)
{
final
Match
match
=
_pattern
.
firstMatch
(
io
.
readString
());
if
(
match
==
null
||
match
.
groupCount
!=
2
)
throw
'unexpected okhttp license file contents'
;
return
new
License
.
fromUrl
(
match
.
group
(
2
),
origin:
io
.
fullName
);
if
(
match
==
null
||
match
.
groupCount
!=
1
)
throw
'unexpected apiclient license file contents'
;
return
new
License
.
fromUrl
(
match
.
group
(
1
),
origin:
io
.
fullName
);
}
@override
License
licenseOfType
(
LicenseType
type
)
{
return
null
;
}
}
class
RepositoryCatapultCoverageLicenseFile
extends
RepositorySingleLicenseFile
{
RepositoryCatapultCoverageLicenseFile
(
RepositoryDirectory
parent
,
fs
.
TextFile
io
)
:
super
(
parent
,
io
,
_parseLicense
(
io
));
static
final
RegExp
_pattern
=
new
RegExp
(
r' *Except where noted otherwise, this software is licensed under the Apache\n'
r' *License, Version 2.0 \(the "License"\); you may not use this work except in\n'
r' *compliance with the License\. You may obtain a copy of the License at\n'
r' *\n'
r' *(http://www\.apache\.org/licenses/LICENSE-2\.0)\n'
r' *\n'
r' *Unless required by applicable law or agreed to in writing, software\n'
r' *distributed under the License is distributed on an "AS IS" BASIS,\n'
r' *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.\n'
r' *See the License for the specific language governing permissions and\n'
r' *limitations under the License\.\n'
,
multiLine:
true
,
caseSensitive:
false
,
);
static
License
_parseLicense
(
fs
.
TextFile
io
)
{
final
Match
match
=
_pattern
.
firstMatch
(
io
.
readString
());
if
(
match
==
null
||
match
.
groupCount
!=
1
)
throw
'unexpected coverage license file contents'
;
return
new
License
.
fromUrl
(
match
.
group
(
1
),
origin:
io
.
fullName
);
}
@override
License
licenseOfType
(
LicenseType
type
)
{
if
(
type
==
LicenseType
.
libpng
)
return
defaultLicense
;
return
null
;
}
}
...
...
@@ -1774,17 +1805,6 @@ class RepositoryPkgWhenDirectory extends RepositoryDirectory {
}
}
class
RepositoryOkHttpDirectory
extends
RepositoryDirectory
{
RepositoryOkHttpDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
@override
RepositoryFile
createFile
(
fs
.
IoNode
entry
)
{
if
(
entry
.
name
==
'LICENSE'
)
return
new
RepositoryOkHttpLicenseFile
(
this
,
entry
);
return
super
.
createFile
(
entry
);
}
}
class
RepositorySkiaLibWebPDirectory
extends
RepositoryDirectory
{
RepositorySkiaLibWebPDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
...
...
@@ -1902,6 +1922,8 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec
return
new
RepositoryAndroidPlatformDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'boringssl'
)
return
new
RepositoryBoringSSLDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'catapult'
)
return
new
RepositoryCatapultDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'dart'
)
return
new
RepositoryDartDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'expat'
)
...
...
@@ -1922,8 +1944,6 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec
return
new
RepositoryLibPngDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'libwebp'
)
return
new
RepositoryLibWebpDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'okhttp'
)
return
new
RepositoryOkHttpDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'pkg'
)
return
new
RepositoryPkgDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'skia'
)
...
...
@@ -2026,6 +2046,52 @@ class RepositoryBoringSSLDirectory extends RepositoryDirectory {
}
}
class
RepositoryCatapultThirdPartyApiClientDirectory
extends
RepositoryDirectory
{
RepositoryCatapultThirdPartyApiClientDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
@override
RepositoryFile
createFile
(
fs
.
IoNode
entry
)
{
if
(
entry
.
name
==
'LICENSE'
)
return
new
RepositoryCatapultApiClientLicenseFile
(
this
,
entry
);
return
super
.
createFile
(
entry
);
}
}
class
RepositoryCatapultThirdPartyCoverageDirectory
extends
RepositoryDirectory
{
RepositoryCatapultThirdPartyCoverageDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
@override
RepositoryFile
createFile
(
fs
.
IoNode
entry
)
{
if
(
entry
.
name
==
'NOTICE.txt'
)
return
new
RepositoryCatapultCoverageLicenseFile
(
this
,
entry
);
return
super
.
createFile
(
entry
);
}
}
class
RepositoryCatapultThirdPartyDirectory
extends
RepositoryDirectory
{
RepositoryCatapultThirdPartyDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
@override
RepositoryDirectory
createSubdirectory
(
fs
.
Directory
entry
)
{
if
(
entry
.
name
==
'apiclient'
)
return
new
RepositoryCatapultThirdPartyApiClientDirectory
(
this
,
entry
);
if
(
entry
.
name
==
'coverage'
)
return
new
RepositoryCatapultThirdPartyCoverageDirectory
(
this
,
entry
);
return
super
.
createSubdirectory
(
entry
);
}
}
class
RepositoryCatapultDirectory
extends
RepositoryDirectory
{
RepositoryCatapultDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
@override
RepositoryDirectory
createSubdirectory
(
fs
.
Directory
entry
)
{
if
(
entry
.
name
==
'third_party'
)
return
new
RepositoryCatapultThirdPartyDirectory
(
this
,
entry
);
return
super
.
createSubdirectory
(
entry
);
}
}
class
RepositoryDartRuntimeThirdPartyDirectory
extends
RepositoryGenericThirdPartyDirectory
{
RepositoryDartRuntimeThirdPartyDirectory
(
RepositoryDirectory
parent
,
fs
.
Directory
io
)
:
super
(
parent
,
io
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录