Skip to content

Commit ee64586

Browse files
committed
attempt to silence appveyor builds
don't print a warning if an anon lib doesn't have docs Closes #797 Closes #772 Squashed commit of the following: commit 366e6bf Author: Seth Ladd <[email protected]> Date: Sat Aug 8 07:25:10 2015 -0700 attempt to silence appveyor builds commit 41ee8e8 Author: Seth Ladd <[email protected]> Date: Sat Aug 8 07:19:52 2015 -0700 don't print a warning if an anon lib doesn't have docs
1 parent 88e14f9 commit ee64586

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ install:
99
- set PATH=%PATH%;%APPDATA%\Pub\Cache\bin
1010
- pub get
1111

12+
# this doesn't seem to be working
1213
build: off
1314

15+
branches:
16+
only:
17+
- disable_builds_for_now
18+
1419
test_script:
1520
- pub run grinder buildbot

lib/src/html_generator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class HtmlGeneratorInstance {
251251
void generateLibrary(Package package, Library lib) {
252252
print('generating docs for library ${lib.name} from ${lib.path}...');
253253

254-
if (!lib.hasDocumentation) {
254+
if (!lib.isAnonymous && !lib.hasDocumentation) {
255255
print(" warning: library '${lib.name}' has no documentation");
256256
}
257257

lib/src/model.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,8 @@ class Library extends ModelElement {
525525
e.nameOffset == element.nameOffset;
526526
}
527527

528+
bool get isAnonymous => element.name == null || element.name.isEmpty;
529+
528530
String get name {
529531
if (_name != null) return _name;
530532

test/model_test.dart

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ void main() {
7878
expect(sdkAsPackage.documentation,
7979
startsWith('Welcome to the Dart API reference doc'));
8080
});
81+
82+
test('has anonymous libraries', () {
83+
expect(
84+
package.libraries.where((lib) => lib.name == 'anonymous_library'),
85+
hasLength(1));
86+
expect(
87+
package.libraries
88+
.where((lib) => lib.name == 'another_anonymous_lib'),
89+
hasLength(1));
90+
});
8191
});
8292

8393
group('test small package', () {
@@ -91,14 +101,17 @@ void main() {
91101
});
92102

93103
group('Library', () {
94-
Library dartAsyncLib;
104+
Library dartAsyncLib, anonLib;
95105

96106
setUp(() {
97107
dartAsyncLib = new Library(
98108
getSdkLibrariesToDocument(
99109
testUtils.sdkDir, testUtils.analyzerHelper.context).first,
100110
sdkAsPackage);
101111

112+
anonLib = package.libraries
113+
.firstWhere((lib) => lib.name == 'anonymous_library');
114+
102115
// Make sure the first library is dart:async
103116
expect(dartAsyncLib.name, 'dart:async');
104117
});
@@ -151,12 +164,8 @@ void main() {
151164
exLibrary.functions.any((f) => f.name == 'helperFunction'), isFalse);
152165
});
153166

154-
test('anonymous libraries', () {
155-
expect(package.libraries.where((lib) => lib.name == 'anonymous_library'),
156-
hasLength(1));
157-
expect(
158-
package.libraries.where((lib) => lib.name == 'another_anonymous_lib'),
159-
hasLength(1));
167+
test('anonymous lib', () {
168+
expect(anonLib.isAnonymous, isTrue);
160169
});
161170
});
162171

0 commit comments

Comments
 (0)