Skip to content

Commit ef66f10

Browse files
Adding style
1 parent c372fb3 commit ef66f10

File tree

16 files changed

+224
-11
lines changed

16 files changed

+224
-11
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>org.clebert</groupId>
8-
<artifactId>gitparser</artifactId>
8+
<artifactId>git-release-report</artifactId>
99
<version>0.1.SNAPSHOT</version>
1010

11-
<name>gitparser</name>
11+
<name>git-release-report</name>
1212
<!-- FIXME change it to the project's website -->
1313
<url>http://www.example.com</url>
1414

src/main/java/org/redhat/gitparser/ArtemisParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public static void main(String arg[]) {
4545
}
4646

4747
parser.addInterestingfolder("test").addInterestingfolder("docs/").addInterestingfolder("examples/");
48-
PrintStream stream = new PrintStream(new FileOutputStream(arg[1]));
49-
parser.parse(stream, arg[2], arg[3]);
48+
File file = new File(arg[1]);
49+
parser.parse(file, arg[2], arg[3]);
5050

5151
} catch (Exception e) {
5252
e.printStackTrace();

src/main/java/org/redhat/gitparser/GitParser.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import javax.json.JsonObject;
2222
import java.io.ByteArrayOutputStream;
2323
import java.io.File;
24+
import java.io.FileOutputStream;
2425
import java.io.IOException;
2526
import java.io.InputStream;
2627
import java.io.OutputStream;
@@ -207,8 +208,28 @@ private String getField(JsonObject object, String name) {
207208
return " ";
208209
}
209210
}
211+
private void copy(String name, File directory) throws Exception {
212+
directory.mkdirs();
213+
InputStream stream = this.getClass().getResourceAsStream(name);
214+
File file = new File(directory, name);
215+
copy(stream, new FileOutputStream(file));
216+
}
217+
218+
public void parse(File outputFile, String from, String to) throws Exception {
219+
220+
PrintStream output = new PrintStream(new FileOutputStream(outputFile));
221+
222+
File styleDirectory = new File(outputFile.getParent(), "styles");
223+
File imageDirectory = new File(outputFile.getParent(), "images");
224+
225+
copy("framework.css", styleDirectory);
226+
copy("jquery.dataTables.min.css", styleDirectory);
227+
copy("jquery.dataTables.min.js", styleDirectory);
228+
copy("jquery.min.js", styleDirectory);
210229

211-
public void parse(PrintStream output, String from, String to) throws Exception {
230+
copy("sort_both.png", imageDirectory);
231+
copy("sort_asc.png", imageDirectory);
232+
copy("sort_desc.png", imageDirectory);
212233
Git git = Git.open(folder);
213234
RevWalk walk = new RevWalk(git.getRepository());
214235

src/main/java/org/redhat/gitparser/WildflyParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ public static void main(String arg[]) {
3838
setSourceSuffix(".java", ".md", ".c", ".sh", ".groovy", ".adoc").
3939
setSampleJQL("https://issues.jboss.org/issues/?jql=project%20%3D%20WildFly%20AND%20KEY%20IN");
4040
parser.addInterestingfolder("test").addInterestingfolder("docs/");
41-
PrintStream stream = new PrintStream(new FileOutputStream(arg[1]));
41+
42+
File file = new File(arg[1]);
4243

4344
parser.setRestLocation("https://issues.jboss.org/rest/api/2/issue/");
4445

45-
parser.parse(stream, arg[2], arg[3]);
46+
parser.parse(file, arg[2], arg[3]);
4647

4748
} catch (Exception e) {
4849
e.printStackTrace();
26.8 KB
Binary file not shown.
894 Bytes
Binary file not shown.

src/main/resources/org/redhat/gitparser/framework.css

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/org/redhat/gitparser/header.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<html>
22
<head>
33

4-
<link type="text/css" rel="stylesheet" href="https://assets-cdn.github.com/assets/frameworks-592c4aa40e940d1b0607a3cf272916ff.css"/>
4+
<!-- taken from https://assets-cdn.github.com/assets/frameworks-592c4aa40e940d1b0607a3cf272916ff.css -->
5+
<link type="text/css" rel="stylesheet" href="styles/framework.css"/>
6+
7+
<!-- taken from http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js -->
8+
<script src="styles/jquery.min.js"></script>
9+
10+
<!-- taken from https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css -->
11+
<link rel="stylesheet" type="text/css" href="styles/jquery.dataTables.min.css">
12+
13+
<!-- taken from https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js -->
14+
<script type="text/javascript" charset="utf8" src="styles/jquery.dataTables.min.js"></script>
515

6-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
7-
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
8-
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
916
<script type="text/javascript" class="init">
1017

1118
$(document).ready( function () {

src/main/resources/org/redhat/gitparser/jquery.dataTables.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)