mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:51:29 +00:00
Rename snapshot, other user-visible parts of docgen to dartdocgen.
BUG= R=ricow@google.com Committed: https://code.google.com/p/dart/source/detail?r=41529 Review URL: https://codereview.chromium.org//696123005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41571 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
55dac6a763
commit
b9be0df603
|
@ -62,8 +62,8 @@ void main(List<String> arguments) {
|
||||||
* Print help if we are passed the help option or invalid arguments.
|
* Print help if we are passed the help option or invalid arguments.
|
||||||
*/
|
*/
|
||||||
void _printHelpAndExit() {
|
void _printHelpAndExit() {
|
||||||
print(_initArgParser().getUsage());
|
print(_initArgParser().usage);
|
||||||
print('Usage: dart docgen.dart [OPTIONS] fooDir/barFile');
|
print('Usage: dartdocgen [OPTIONS] fooDir/barFile');
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
36
sdk/bin/dartdocgen
Executable file
36
sdk/bin/dartdocgen
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||||
|
# for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
# BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
function follow_links() {
|
||||||
|
file="$1"
|
||||||
|
while [ -h "$file" ]; do
|
||||||
|
# On Mac OS, readlink -f doesn't work.
|
||||||
|
file="$(readlink "$file")"
|
||||||
|
done
|
||||||
|
echo "$file"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
|
||||||
|
PROG_NAME="$(follow_links "$BASH_SOURCE")"
|
||||||
|
|
||||||
|
# Handle the case where dart-sdk/bin has been symlinked to.
|
||||||
|
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
||||||
|
|
||||||
|
SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
|
||||||
|
|
||||||
|
unset SNAPSHOT
|
||||||
|
|
||||||
|
SNAPSHOT="$BIN_DIR/snapshots/utils_wrapper.dart.snapshot"
|
||||||
|
|
||||||
|
if test -f "$SNAPSHOT"; then
|
||||||
|
exec "$BIN_DIR"/dart \
|
||||||
|
"--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
|
||||||
|
"$SNAPSHOT" \
|
||||||
|
docgen "--sdk=$SDK_DIR" "$@"
|
||||||
|
else
|
||||||
|
exec "$BIN_DIR"/dart \
|
||||||
|
"--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
|
||||||
|
"$BIN_DIR/../../pkg/docgen/bin/docgen.dart" "--sdk=$SDK_DIR" "$@"
|
||||||
|
fi
|
49
sdk/bin/dartdocgen.bat
Normal file
49
sdk/bin/dartdocgen.bat
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
@echo off
|
||||||
|
REM Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||||
|
REM for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
REM BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
setlocal
|
||||||
|
rem Handle the case where dart-sdk/bin has been symlinked to.
|
||||||
|
set DIR_NAME_WITH_SLASH=%~dp0
|
||||||
|
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
|
||||||
|
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
|
||||||
|
rem Get rid of surrounding quotes.
|
||||||
|
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
|
||||||
|
|
||||||
|
rem Get absolute full name for SDK_DIR.
|
||||||
|
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
|
||||||
|
|
||||||
|
rem Remove trailing backslash if there is one
|
||||||
|
IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
|
||||||
|
|
||||||
|
set DOCGEN=%SDK_DIR%\pkg\docgen\bin\docgen.dart
|
||||||
|
set DART=%BIN_DIR%\dart
|
||||||
|
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot
|
||||||
|
|
||||||
|
if not defined DART_CONFIGURATION set DART_CONFIGURATION=ReleaseIA32
|
||||||
|
|
||||||
|
set BUILD_DIR=%SDK_DIR%\..\build\%DART_CONFIGURATION%
|
||||||
|
if exist "%SNAPSHOT%" (
|
||||||
|
"%DART%" "%SNAPSHOT%" "docgen" "--sdk=%SDK_DIR%" %*
|
||||||
|
) else (
|
||||||
|
"%BUILD_DIR%\dart-sdk\bin\dart" "--package-root=%BUILD_DIR%\packages" "%DOCGEN%" "--sdk=%SDK_DIR%" %*
|
||||||
|
)
|
||||||
|
|
||||||
|
endlocal
|
||||||
|
|
||||||
|
exit /b %errorlevel%
|
||||||
|
|
||||||
|
:follow_links
|
||||||
|
setlocal
|
||||||
|
for %%i in (%1) do set result=%%~fi
|
||||||
|
set current=
|
||||||
|
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
|
||||||
|
^| find "> %~n1 ["') do (
|
||||||
|
set current=%%i
|
||||||
|
)
|
||||||
|
if not "%current%"=="" call :follow_links "%current%", result
|
||||||
|
endlocal & set %~2=%result%
|
||||||
|
goto :eof
|
||||||
|
|
||||||
|
:end
|
|
@ -3,34 +3,5 @@
|
||||||
# for details. All rights reserved. Use of this source code is governed by a
|
# for details. All rights reserved. Use of this source code is governed by a
|
||||||
# BSD-style license that can be found in the LICENSE file.
|
# BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
function follow_links() {
|
echo "The 'docgen' name is deprecated. Prefer 'dartdocgen' instead."
|
||||||
file="$1"
|
dartdocgen "$@"
|
||||||
while [ -h "$file" ]; do
|
|
||||||
# On Mac OS, readlink -f doesn't work.
|
|
||||||
file="$(readlink "$file")"
|
|
||||||
done
|
|
||||||
echo "$file"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
|
|
||||||
PROG_NAME="$(follow_links "$BASH_SOURCE")"
|
|
||||||
|
|
||||||
# Handle the case where dart-sdk/bin has been symlinked to.
|
|
||||||
BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
|
|
||||||
|
|
||||||
SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
|
|
||||||
|
|
||||||
unset SNAPSHOT
|
|
||||||
|
|
||||||
SNAPSHOT="$BIN_DIR/snapshots/utils_wrapper.dart.snapshot"
|
|
||||||
|
|
||||||
if test -f "$SNAPSHOT"; then
|
|
||||||
exec "$BIN_DIR"/dart \
|
|
||||||
"--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
|
|
||||||
"$SNAPSHOT" \
|
|
||||||
docgen "--sdk=$SDK_DIR" "$@"
|
|
||||||
else
|
|
||||||
exec "$BIN_DIR"/dart \
|
|
||||||
"--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
|
|
||||||
"$BIN_DIR/../../pkg/docgen/bin/docgen.dart" "--sdk=$SDK_DIR" "$@"
|
|
||||||
fi
|
|
||||||
|
|
|
@ -3,47 +3,5 @@ REM Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||||
REM for details. All rights reserved. Use of this source code is governed by a
|
REM for details. All rights reserved. Use of this source code is governed by a
|
||||||
REM BSD-style license that can be found in the LICENSE file.
|
REM BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
setlocal
|
echo "The 'docgen.bat' name is deprecated. Prefer 'dartdocgen.bat' instead."
|
||||||
rem Handle the case where dart-sdk/bin has been symlinked to.
|
dartdocgen %*
|
||||||
set DIR_NAME_WITH_SLASH=%~dp0
|
|
||||||
set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
|
|
||||||
call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
|
|
||||||
rem Get rid of surrounding quotes.
|
|
||||||
for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
|
|
||||||
|
|
||||||
rem Get absolute full name for SDK_DIR.
|
|
||||||
for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
|
|
||||||
|
|
||||||
rem Remove trailing backslash if there is one
|
|
||||||
IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
|
|
||||||
|
|
||||||
set DOCGEN=%SDK_DIR%\pkg\docgen\bin\docgen.dart
|
|
||||||
set DART=%BIN_DIR%\dart
|
|
||||||
set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot
|
|
||||||
|
|
||||||
if not defined DART_CONFIGURATION set DART_CONFIGURATION=ReleaseIA32
|
|
||||||
|
|
||||||
set BUILD_DIR=%SDK_DIR%\..\build\%DART_CONFIGURATION%
|
|
||||||
if exist "%SNAPSHOT%" (
|
|
||||||
"%DART%" "%SNAPSHOT%" "docgen" "--sdk=%SDK_DIR%" %*
|
|
||||||
) else (
|
|
||||||
"%BUILD_DIR%\dart-sdk\bin\dart" "--package-root=%BUILD_DIR%\packages" "%DOCGEN%" "--sdk=%SDK_DIR%" %*
|
|
||||||
)
|
|
||||||
|
|
||||||
endlocal
|
|
||||||
|
|
||||||
exit /b %errorlevel%
|
|
||||||
|
|
||||||
:follow_links
|
|
||||||
setlocal
|
|
||||||
for %%i in (%1) do set result=%%~fi
|
|
||||||
set current=
|
|
||||||
for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
|
|
||||||
^| find "> %~n1 ["') do (
|
|
||||||
set current=%%i
|
|
||||||
)
|
|
||||||
if not "%current%"=="" call :follow_links "%current%", result
|
|
||||||
endlocal & set %~2=%result%
|
|
||||||
goto :eof
|
|
||||||
|
|
||||||
:end
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ def CopyShellScript(src_file, dest_dir):
|
||||||
|
|
||||||
def CopyDartScripts(home, sdk_root):
|
def CopyDartScripts(home, sdk_root):
|
||||||
for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt', 'docgen',
|
for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt', 'docgen',
|
||||||
'pub_sdk']:
|
'dartdocgen', 'pub_sdk']:
|
||||||
CopyShellScript(os.path.join(home, 'sdk', 'bin', executable),
|
CopyShellScript(os.path.join(home, 'sdk', 'bin', executable),
|
||||||
os.path.join(sdk_root, 'bin'))
|
os.path.join(sdk_root, 'bin'))
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
],
|
],
|
||||||
'targets': [
|
'targets': [
|
||||||
{
|
{
|
||||||
'target_name': 'docgen',
|
'target_name': 'dartdocgen',
|
||||||
'type': 'none',
|
'type': 'none',
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'../../create_sdk.gyp:create_sdk_internal',
|
'../../create_sdk.gyp:create_sdk_internal',
|
||||||
|
@ -63,8 +63,12 @@
|
||||||
'../../sdk/bin/dart.bat',
|
'../../sdk/bin/dart.bat',
|
||||||
'../../sdk/bin/dart2js',
|
'../../sdk/bin/dart2js',
|
||||||
'../../sdk/bin/dart2js.bat',
|
'../../sdk/bin/dart2js.bat',
|
||||||
|
# TODO(alanknight): The docgen name is deprecated in favour of
|
||||||
|
# dartdocgen, and should be removed eventually.
|
||||||
'../../sdk/bin/docgen',
|
'../../sdk/bin/docgen',
|
||||||
|
'../../sdk/bin/dartdocgen',
|
||||||
'../../sdk/bin/docgen.bat',
|
'../../sdk/bin/docgen.bat',
|
||||||
|
'../../sdk/bin/dartdocgen.bat',
|
||||||
'../../tools/only_in_release_mode.py',
|
'../../tools/only_in_release_mode.py',
|
||||||
'<(PRODUCT_DIR)/dart-sdk/README',
|
'<(PRODUCT_DIR)/dart-sdk/README',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
|
'<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
|
||||||
|
@ -77,7 +81,7 @@
|
||||||
'../../tools/only_in_release_mode.py',
|
'../../tools/only_in_release_mode.py',
|
||||||
'<@(_outputs)',
|
'<@(_outputs)',
|
||||||
'--',
|
'--',
|
||||||
'<(PRODUCT_DIR)/dart-sdk/bin/docgen<(script_suffix)',
|
'<(PRODUCT_DIR)/dart-sdk/bin/dartdocgen<(script_suffix)',
|
||||||
'--out=<(PRODUCT_DIR)/api_docs/docgen',
|
'--out=<(PRODUCT_DIR)/api_docs/docgen',
|
||||||
'--include-sdk',
|
'--include-sdk',
|
||||||
'--no-include-dependent-packages',
|
'--no-include-dependent-packages',
|
||||||
|
@ -90,7 +94,7 @@
|
||||||
'--exclude-lib=try',
|
'--exclude-lib=try',
|
||||||
'../../pkg'
|
'../../pkg'
|
||||||
],
|
],
|
||||||
'message': 'Running docgen: <(_action)',
|
'message': 'Running dartdocgen: <(_action)',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue