Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
Openfire
Commits
e5e67a1b
Commit
e5e67a1b
authored
Nov 19, 2015
by
Tom Evans
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #361 from akrherz/jivetools
Add Legacy Jive build code for eventual removal
parents
67baf287
7f06ad30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
215 additions
and
0 deletions
+215
-0
BaseSelector.java
src/java/com/jivesoftware/tools/selector/BaseSelector.java
+111
-0
EditionSelector.java
...java/com/jivesoftware/tools/selector/EditionSelector.java
+44
-0
IncludeSourceSelector.java
...om/jivesoftware/tools/selector/IncludeSourceSelector.java
+20
-0
JavaDocSelector.java
...java/com/jivesoftware/tools/selector/JavaDocSelector.java
+40
-0
No files found.
src/java/com/jivesoftware/tools/selector/BaseSelector.java
0 → 100644
View file @
e5e67a1b
package
com
.
jivesoftware
.
tools
.
selector
;
import
com.thoughtworks.qdox.JavaDocBuilder
;
import
com.thoughtworks.qdox.model.ClassLibrary
;
import
com.thoughtworks.qdox.model.DefaultDocletTagFactory
;
import
com.thoughtworks.qdox.model.DocletTag
;
import
com.thoughtworks.qdox.model.JavaClass
;
import
com.thoughtworks.qdox.model.JavaSource
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.PrintStream
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Properties
;
import
org.apache.tools.ant.BuildException
;
import
org.apache.tools.ant.types.selectors.BaseSelectorContainer
;
public
abstract
class
BaseSelector
extends
BaseSelectorContainer
{
private
static
Map
sourcesMap
=
new
HashMap
();
private
static
Map
packagesMap
=
new
HashMap
();
private
String
packages
;
public
boolean
isSelected
(
File
paramFile1
,
String
paramString
,
File
paramFile2
)
throws
BuildException
{
if
(
paramString
.
endsWith
(
".java"
))
{
JavaSource
[]
arrayOfJavaSource
=
getSources
(
paramFile1
);
for
(
int
i
=
0
;
i
<
arrayOfJavaSource
.
length
;
i
++)
{
JavaSource
localJavaSource
=
arrayOfJavaSource
[
i
];
File
localFile
=
new
File
(
localJavaSource
.
getURL
().
getFile
());
if
((
localFile
.
equals
(
paramFile2
))
&&
(
localJavaSource
.
getClasses
().
length
>
0
))
{
JavaClass
localJavaClass
=
localJavaSource
.
getClasses
()[
0
];
String
str
=
getTagName
();
DocletTag
localDocletTag
=
localJavaClass
.
getTagByName
(
str
);
if
(
localDocletTag
==
null
)
{
return
handleNoTag
(
localJavaClass
,
paramFile2
);
}
System
.
out
.
println
(
"Checking '"
+
str
+
"' tag for "
+
paramString
);
return
shouldCopy
(
localDocletTag
.
getValue
());
}
}
}
else
if
(
"javadocs.properties"
.
equals
(
paramFile2
.
getName
()))
{
return
false
;
}
return
true
;
}
private
boolean
handleNoTag
(
JavaClass
paramJavaClass
,
File
paramFile
)
{
File
localFile1
=
paramFile
.
getParentFile
();
String
str1
=
paramJavaClass
.
getPackage
();
int
i
=
str1
.
split
(
"\\."
).
length
;
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
File
localFile2
=
new
File
(
localFile1
,
"javadocs.properties"
);
if
(
localFile2
.
exists
())
{
Properties
localProperties
=
new
Properties
();
try
{
localProperties
.
load
(
new
FileInputStream
(
localFile2
));
}
catch
(
IOException
localIOException
)
{
localIOException
.
printStackTrace
();
}
String
str2
=
getTagName
();
String
str3
=
localProperties
.
getProperty
(
str2
);
if
(
str3
!=
null
)
{
return
shouldCopy
(
str3
);
}
}
localFile1
=
localFile1
.
getParentFile
();
}
return
shouldCopyWithNoTag
();
}
protected
JavaSource
[]
getSources
(
File
paramFile
)
{
JavaSource
[]
arrayOfJavaSource
=
(
JavaSource
[])
sourcesMap
.
get
(
paramFile
.
toString
());
if
(
arrayOfJavaSource
==
null
)
{
JavaDocBuilder
localJavaDocBuilder
=
new
JavaDocBuilder
(
new
DefaultDocletTagFactory
());
localJavaDocBuilder
.
getClassLibrary
().
addClassLoader
(
getClass
().
getClassLoader
());
localJavaDocBuilder
.
addSourceTree
(
paramFile
);
arrayOfJavaSource
=
localJavaDocBuilder
.
getSources
();
sourcesMap
.
put
(
paramFile
.
toString
(),
arrayOfJavaSource
);
}
return
arrayOfJavaSource
;
}
public
void
setPackages
(
String
paramString
)
{
this
.
packages
=
paramString
;
}
protected
abstract
String
getTagName
();
protected
abstract
boolean
shouldCopyWithNoTag
();
protected
abstract
boolean
shouldCopy
(
String
paramString
);
}
src/java/com/jivesoftware/tools/selector/EditionSelector.java
0 → 100644
View file @
e5e67a1b
package
com
.
jivesoftware
.
tools
.
selector
;
public
class
EditionSelector
extends
BaseSelector
{
public
static
final
String
EDITION_PRO
=
"professional"
;
public
static
final
String
EDITION_SILVER
=
"silver"
;
public
static
final
String
EDITION_GOLD
=
"gold"
;
String
edition
=
"gold"
;
protected
String
getTagName
()
{
return
"edition"
;
}
protected
boolean
shouldCopyWithNoTag
()
{
return
true
;
}
protected
boolean
shouldCopy
(
String
paramString
)
{
if
(
"gold"
.
equals
(
this
.
edition
))
{
return
true
;
}
if
(
"silver"
.
equals
(
this
.
edition
))
{
return
!
"gold"
.
equals
(
paramString
);
}
if
(
"professional"
.
equals
(
this
.
edition
))
{
if
(
"gold"
.
equals
(
paramString
))
{
return
false
;
}
return
!
"silver"
.
equals
(
paramString
);
}
setError
(
"Unknown selector: "
+
this
.
edition
);
return
false
;
}
public
void
setEdition
(
String
paramString
)
{
this
.
edition
=
paramString
;
}
}
src/java/com/jivesoftware/tools/selector/IncludeSourceSelector.java
0 → 100644
View file @
e5e67a1b
package
com
.
jivesoftware
.
tools
.
selector
;
public
class
IncludeSourceSelector
extends
BaseSelector
{
protected
String
getTagName
()
{
return
"src.include"
;
}
protected
boolean
shouldCopyWithNoTag
()
{
return
true
;
}
protected
boolean
shouldCopy
(
String
paramString
)
{
return
!
"false"
.
equals
(
paramString
);
}
}
src/java/com/jivesoftware/tools/selector/JavaDocSelector.java
0 → 100644
View file @
e5e67a1b
package
com
.
jivesoftware
.
tools
.
selector
;
public
class
JavaDocSelector
extends
BaseSelector
{
public
static
final
String
VERSION_API
=
"api"
;
public
static
final
String
VERSION_DEV
=
"dev"
;
public
static
final
String
VERSION_NONE
=
"none"
;
String
version
=
"dev"
;
protected
String
getTagName
()
{
return
"javadoc"
;
}
protected
boolean
shouldCopyWithNoTag
()
{
return
"dev"
.
equals
(
this
.
version
);
}
protected
boolean
shouldCopy
(
String
paramString
)
{
if
(
"none"
.
equals
(
paramString
))
{
return
false
;
}
if
(
"dev"
.
equals
(
this
.
version
))
{
return
true
;
}
if
(
"api"
.
equals
(
this
.
version
))
{
return
"api"
.
equals
(
paramString
);
}
setError
(
"Unknown selector: "
+
this
.
version
);
return
false
;
}
public
void
setVersion
(
String
paramString
)
{
this
.
version
=
paramString
;
}
}
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