Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Ragdoc Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
Ragdoc Builder
Commits
1c70c416
Commit
1c70c416
authored
7 years ago
by
Jesper
Browse files
Options
Downloads
Patches
Plain Diff
Add -ragroot option
parent
787f780c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.gradle
+1
-0
1 addition, 0 deletions
build.gradle
src/java/org/extendj/ragdoc/RagDocBuilder.java
+27
-11
27 additions, 11 deletions
src/java/org/extendj/ragdoc/RagDocBuilder.java
with
28 additions
and
11 deletions
build.gradle
+
1
−
0
View file @
1c70c416
...
...
@@ -15,6 +15,7 @@ repositories {
apply
plugin:
'java'
apply
plugin:
'jastadd'
apply
plugin:
'maven'
version
=
'1.3.0'
group
=
'org.extendj'
...
...
This diff is collapsed.
Click to expand it.
src/java/org/extendj/ragdoc/RagDocBuilder.java
+
27
−
11
View file @
1c70c416
...
...
@@ -73,15 +73,6 @@ public class RagDocBuilder extends Frontend {
* @return {@code true} if documentation generation succeeds
*/
public
int
compile
(
String
[]
args
)
{
// TODO use command-line arg for ragRoot!
// TODO add package exclude argument.
File
userDir
=
new
File
(
System
.
getProperty
(
"user.dir"
));
if
(
userDir
.
isDirectory
())
{
jsonBuilder
=
new
JsonBuilder
(
userDir
);
}
else
{
jsonBuilder
=
new
JsonBuilder
(
new
File
(
"."
));
}
ASTNode
.
jsonBuilder
=
jsonBuilder
;
return
run
(
args
,
Program
.
defaultBytecodeReader
(),
Program
.
defaultJavaParser
());
}
...
...
@@ -90,7 +81,7 @@ public class RagDocBuilder extends Frontend {
long
start
=
System
.
currentTimeMillis
();
int
result
=
super
.
run
(
args
,
reader
,
parser
);
long
time
=
System
.
currentTimeMillis
()
-
start
;
System
.
out
.
format
(
"Analysis took %fs%n"
,
time
/
1000.0
);
System
.
out
.
format
(
"Analysis took %
.1
fs
.
%n"
,
time
/
1000.0
);
try
{
File
outputDir
;
if
(
program
.
options
().
hasValueForOption
(
"-d"
))
{
...
...
@@ -105,6 +96,7 @@ public class RagDocBuilder extends Frontend {
System
.
err
.
format
(
"Error: not a valid output directory: '%s'\n"
,
outputDir
.
getName
());
return
EXIT_CONFIG_ERROR
;
}
System
.
out
.
println
(
"Writing ragdoc metadata to: "
+
outputDir
.
getPath
());
System
.
out
.
println
(
"Writing package summary."
);
outputJson
(
outputDir
,
"packages.json"
,
jsonBuilder
.
packageIndex
());
...
...
@@ -121,7 +113,7 @@ public class RagDocBuilder extends Frontend {
for
(
Map
.
Entry
<
String
,
File
>
entry
:
jsonBuilder
.
sourceFiles
.
entrySet
())
{
File
file
=
entry
.
getValue
();
String
path
=
entry
.
getKey
();
path
=
path
.
replace
(
'/'
,
'_'
).
replace
(
'\\'
,
'_'
);
path
=
path
.
replace
(
'/'
,
'_'
).
replace
(
'\\'
,
'_'
).
replace
(
'.'
,
'_'
);
copyFile
(
outputDir
,
path
,
file
);
}
}
catch
(
IOException
e
)
{
...
...
@@ -181,6 +173,30 @@ public class RagDocBuilder extends Frontend {
@Override
protected
void
initOptions
()
{
super
.
initOptions
();
program
.
options
().
addKeyValueOption
(
"-ragroot"
);
}
@Override
protected
int
processArgs
(
String
[]
args
)
{
int
result
=
super
.
processArgs
(
args
);
if
(
result
==
0
)
{
// TODO add package exclude argument.
File
ragRoot
;
if
(
program
.
options
().
hasValueForOption
(
"-ragroot"
))
{
ragRoot
=
new
File
(
program
.
options
().
getValueForOption
(
"-ragroot"
));
}
else
{
System
.
out
.
println
(
"No ragroot directory specified. Using default."
);
File
userDir
=
new
File
(
System
.
getProperty
(
"user.dir"
));
if
(
userDir
.
isDirectory
())
{
ragRoot
=
userDir
;
}
else
{
ragRoot
=
new
File
(
"."
);
}
}
System
.
out
.
println
(
"Using ragroot directory: "
+
ragRoot
.
getAbsolutePath
());
jsonBuilder
=
new
JsonBuilder
(
ragRoot
);
ASTNode
.
jsonBuilder
=
jsonBuilder
;
}
return
result
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment