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
ac2f6ed2
Unverified
Commit
ac2f6ed2
authored
Aug 10, 2022
by
godofredoc
Committed by
GitHub
Aug 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy doc files from new to old location. (#109316)
parent
05f6946c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
java_and_objc_doc.dart
dev/tools/java_and_objc_doc.dart
+21
-0
No files found.
dev/tools/java_and_objc_doc.dart
View file @
ac2f6ed2
...
...
@@ -7,6 +7,7 @@ import 'dart:math';
import
'package:archive/archive.dart'
;
import
'package:http/http.dart'
as
http
;
import
'package:path/path.dart'
as
path
;
const
String
kDocRoot
=
'dev/docs/doc'
;
...
...
@@ -63,6 +64,12 @@ Future<void> generateDocs(String url, String docName, String checkFile) async {
}
}
/// If object then copy files to old location if the archive is using the new location.
final
bool
exists
=
Directory
(
'
$kDocRoot
/
$docName
/objectc_docs'
).
existsSync
();
if
(
exists
)
{
copyFolder
(
Directory
(
'
$kDocRoot
/
$docName
/objectc_docs'
),
Directory
(
'
$kDocRoot
/
$docName
/'
));
}
final
File
testFile
=
File
(
'
${output.path}
/
$checkFile
'
);
if
(!
testFile
.
existsSync
())
{
print
(
'Expected file
${testFile.path}
not found'
);
...
...
@@ -70,3 +77,17 @@ Future<void> generateDocs(String url, String docName, String checkFile) async {
}
print
(
'
$docName
ready to go!'
);
}
/// Copies the files in a directory recursively to a new location.
void
copyFolder
(
Directory
source
,
Directory
destination
)
{
source
.
listSync
()
.
forEach
((
FileSystemEntity
entity
)
{
if
(
entity
is
Directory
)
{
final
Directory
newDirectory
=
Directory
(
path
.
join
(
destination
.
absolute
.
path
,
path
.
basename
(
entity
.
path
)));
newDirectory
.
createSync
();
copyFolder
(
entity
.
absolute
,
newDirectory
);
}
else
if
(
entity
is
File
)
{
entity
.
copySync
(
path
.
join
(
destination
.
path
,
path
.
basename
(
entity
.
path
)));
}
});
}
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