From a7b20fdea564ff26036dfa23e16f0b955dfbafb6 Mon Sep 17 00:00:00 2001 From: Tomas Bjerre Date: Wed, 27 Jan 2016 19:14:33 +0100 Subject: [PATCH] Removing command line code #11 --- CHANGELOG.md | 14 +- README.md | 109 +------ build.gradle | 23 +- build.sh | 3 +- generate_changelog.sh | 2 +- .../java/se/bjurr/gitchangelog/main/Main.java | 308 ------------------ .../api/GitChangelogApiAsserter.java | 18 - 7 files changed, 31 insertions(+), 446 deletions(-) delete mode 100644 src/main/java/se/bjurr/gitchangelog/main/Main.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 33f7ac72..cbeeaf12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,19 @@ Changelog of Git Changelog. ## Next release ### Other changes -[01c3111e3bd06ea](https://github.com/tomasbjerre/git-changelog-lib/commit/01c3111e3bd06ea) Tomas Bjerre *2015-12-08 18:43:35* +[d405f4e8ae5f34f](https://github.com/tomasbjerre/git-changelog-lib/commit/d405f4e8ae5f34f) Tomas Bjerre *2015-12-11 07:56:23* + +Changing Jenkins plugin link to point at JenkinsCI + +[296d811a7ec3492](https://github.com/tomasbjerre/git-changelog-lib/commit/296d811a7ec3492) Tomas Bjerre *2015-12-10 17:12:44* + +Adding example template to readme + + +## 1.18 +### Other changes + +[25fad813507296c](https://github.com/tomasbjerre/git-changelog-lib/commit/25fad813507296c) Tomas Bjerre *2015-12-08 18:44:25* Downgrading JGIT to 3.6.2 to be compatible with its older API diff --git a/README.md b/README.md index 3cfc2913..b7e56eaa 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ This software can be used: * With a [Maven plugin](https://github.com/tomasbjerre/git-changelog-maven-plugin). * With a [Jenkins plugin](https://github.com/jenkinsci/git-changelog-plugin). * With a [Bitbucket Server plugin](https://github.com/tomasbjerre/git-changelog-bitbucket-plugin). + * From [command line](https://github.com/tomasbjerre/git-changelog-command-line). * As a library [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22git-changelog-lib%22). - * From command line [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22git-changelog-lib%22) (the zip file). Here is an example template. There are more examples [here](https://github.com/tomasbjerre/git-changelog/tree/master/src/test/resources/templates). ``` @@ -79,113 +79,6 @@ A page can be created in MediaWiki like this. "Title of page"); ``` -### Command line -Or from command line: -``` --cl, --custom-issue-link Custom issue link. - : any string - Default: null --cn, --custom-issue-name Custom issue name. - : any string - Default: null --cp, --custom-issue-pattern Custom issue pattern. - : any string - Default: null --df, --date-format Format to use when printing dates. - : any string - Default: YYYY-MM-dd HH:mm:ss --fc, --from-commit From commit. - : any string - Default: 0000000000000000000000000000000000000000 --fr, --from-ref From ref. - : any string - Default: null --gapi, --github-api GitHub API. - : any string - Default: --h, --help : an argument to print help for - Default: If no specific parameter is given the whole usage text is given --ip, --ignore-pattern Ignore commits where pattern - matches message. - : any string - Default: ^\[maven-release-plugin\].*|^\[Gradle Release Plugin\].*|^Merge.* --jp, --jira-pattern Jira issue pattern. - : any string - Default: \b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\b --jpw, --jira-password Optional password to authenticate - with Jira. - : any string - Default: \b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\b --js, --jiraServer Jira server. When a Jira server is - given, the title of the Jira issues can be - used in the changelog. - : any string - Default: --ju, --jira-username Optional username to authenticate - with Jira. - : any string - Default: \b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\b --mp, --mediawiki-password Password to authenticate with - MediaWiki. - : any string - Default: --mt, --mediawiki-title Title of MediaWiki page. - : any string - Default: null --mu, --mediawiki-user User to authenticate with MediaWiki. - : any string - Default: --murl, --mediawiki-url Base URL of MediaWiki. - : any string - Default: --ni, --no-issue-name Name of virtual issue that contains - commits that has no issue associated. - : any string - Default: No issue --of, --output-file Write output to file. - : any string - Default: --r, --repo Repository. - : any string - Default: . --ri, --remove-issue-from-message Dont print any issues in the - messages of commits. - Default: disabled --rt, --readable-tag-name Pattern to extract readable part of - tag. - : any string - Default: /([^/]+?)$ --sf, --settings-file Use settings from file. - : any string - Default: null --std, --stdout Print builder to . - Default: disabled --t, --template Template to use. A default template - will be used if not specified. - : any string - Default: git-changelog-template.mustache --tc, --to-commit To commit. - : any string - Default: null --tr, --to-ref To ref. - : any string - Default: refs/heads/master --tz, --time-zone TimeZone to use when printing dates. - : any string - Default: UTC --ut, --untagged-name When listing commits per tag, this - will by the name of a virtual tag that - contains commits not available in any git - tag. - : any string - Default: No tag -``` - -Creating a MediaWiki page can be done like this. -``` -./git-changelog-lib -murl http://localhost/mediawiki -mu tomas -mp tomaskod -mt "Tomas Title" -t /home/bjerre/workspace/git-changelog-lib/changelog_mediawiki.mustache -ut "Next release" -``` - ## Supplied information The template is supplied with a datastructure like: diff --git a/build.gradle b/build.gradle index bdaaaf02..c8f101a0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,24 +1,32 @@ buildscript { repositories { jcenter() + maven { + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' classpath 'net.researchgate:gradle-release:2.2.2' + classpath 'gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.10' } } apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' -apply plugin: 'application' apply plugin: 'signing' apply plugin: 'com.bmuschko.nexus' apply plugin: 'net.researchgate.release' +apply plugin: 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' -group = 'se.bjurr.gitchangelog' +task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) { + gitChangelogPlugin.templateContent = new File('changelog.mustache').getText('UTF-8'); + gitChangelogPlugin.filePath = "CHANGELOG.md"; + gitChangelogPlugin.settingsFile = "changelog.json"; +} -mainClassName = 'se.bjurr.gitchangelog.main.Main' +group = 'se.bjurr.gitchangelog' sourceCompatibility = 1.7 targetCompatibility = 1.7 @@ -31,7 +39,6 @@ repositories { dependencies { compile 'com.jayway.jsonpath:json-path:2.1.0' compile 'com.google.guava:guava:11.0.1' - compile 'se.softhouse:jargo:0.1.1' compile 'org.eclipse.jgit:org.eclipse.jgit:3.6.2.201501210735-r' compile 'com.github.spullara.mustache.java:compiler:0.8.18' compile 'com.google.code.gson:gson:2.4' @@ -55,12 +62,12 @@ modifyPom { project { name 'GIT Changelog' description 'Library that generates changelog from a GIT repository.' - url 'https://github.com/tomasbjerre/git-changelog' + url 'https://github.com/tomasbjerre/git-changelog-lib' inceptionYear '2015' scm { - url 'https://github.com/tomasbjerre/git-changelog' - connection 'scm:https://tomasbjerre@github.com/tomasbjerre/git-changelog.git' - developerConnection 'scm:git://github.com/tomasbjerre/git-changelog.git' + url 'https://github.com/tomasbjerre/git-changelog-lib' + connection 'scm:https://tomasbjerre@github.com/tomasbjerre/git-changelog-lib.git' + developerConnection 'scm:git://github.com/tomasbjerre/git-changelog-lib.git' } licenses { diff --git a/build.sh b/build.sh index bbb3dfed..f6af98e3 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,2 @@ #!/bin/bash -./gradlew clean build -./generate_changelog.sh +./gradlew clean gitChangelog build diff --git a/generate_changelog.sh b/generate_changelog.sh index f7692a4a..8fd87ad9 100755 --- a/generate_changelog.sh +++ b/generate_changelog.sh @@ -3,5 +3,5 @@ ROOT_FOLDER=`pwd` cd build/distributions unzip *T.zip cd *T -./bin/git-changelog-lib -t $ROOT_FOLDER/changelog.mustache -sf $ROOT_FOLDER/changelog.json -of $ROOT_FOLDER/CHANGELOG.md +./bin/git-changelog-lib -t $ROOT_FOLDER/changelog.mustache -sf $ROOT_FOLDER/changelog.json -of $ROOT_FOLDER/CHANGELOG.md -r /home/bjerre/sandbox/timerepo #./bin/git-changelog-lib -t $ROOT_FOLDER/changelog_mediawiki.mustache -sf $ROOT_FOLDER/changelog.json -murl http://localhost/mediawiki -mu tomas -mp tomaskod -mt "Tomas Title" -gapi https://api.github.com/repos/tomasbjerre/git-changelog-lib diff --git a/src/main/java/se/bjurr/gitchangelog/main/Main.java b/src/main/java/se/bjurr/gitchangelog/main/Main.java deleted file mode 100644 index 6d49e64b..00000000 --- a/src/main/java/se/bjurr/gitchangelog/main/Main.java +++ /dev/null @@ -1,308 +0,0 @@ -package se.bjurr.gitchangelog.main; - -import static com.google.common.base.Preconditions.checkArgument; -import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder; -import static se.bjurr.gitchangelog.internal.settings.Settings.defaultSettings; -import static se.softhouse.jargo.Arguments.helpArgument; -import static se.softhouse.jargo.Arguments.optionArgument; -import static se.softhouse.jargo.Arguments.stringArgument; -import static se.softhouse.jargo.CommandLineParser.withArguments; - -import java.io.File; - -import se.bjurr.gitchangelog.api.GitChangelogApi; -import se.bjurr.gitchangelog.internal.settings.Settings; -import se.softhouse.jargo.Argument; -import se.softhouse.jargo.ArgumentException; -import se.softhouse.jargo.ParsedArguments; - -import com.google.common.annotations.VisibleForTesting; - -public class Main { - public static final String PARAM_SETTINGS_FILE = "-sf"; - public static final String PARAM_OUTPUT_FILE = "-of"; - public static final String PARAM_OUTPUT_STDOUT = "-std"; - public static final String PARAM_TEMPLATE = "-t"; - public static final String PARAM_REPO = "-r"; - public static final String PARAM_FROM_REF = "-fr"; - public static final String PARAM_TO_REF = "-tr"; - public static final String PARAM_FROM_COMMIT = "-fc"; - public static final String PARAM_TO_COMMIT = "-tc"; - public static final String PARAM_IGNORE_PATTERN = "-ip"; - public static final String PARAM_JIRA_SERVER = "-js"; - public static final String PARAM_JIRA_ISSUE_PATTERN = "-jp"; - public static final String PARAM_JIRA_USERNAME = "-ju"; - public static final String PARAM_JIRA_PASSWORD = "-jpw"; - public static final String PARAM_CUSTOM_ISSUE_NAME = "-cn"; - public static final String PARAM_CUSTOM_ISSUE_PATTERN = "-cp"; - public static final String PARAM_CUSTOM_ISSUE_LINK = "-cl"; - public static final String PARAM_UNTAGGED_TAG_NAME = "-ut"; - public static final String PARAM_TIMEZONE = "-tz"; - public static final String PARAM_DATEFORMAT = "-df"; - public static final String PARAM_NOISSUE = "-ni"; - public static final String PARAM_READABLETAGNAME = "-rt"; - public static final String PARAM_REMOVEISSUE = "-ri"; - public static final String PARAM_MEDIAWIKIURL = "-murl"; - public static final String PARAM_MEDIAWIKITITLE = "-mt"; - public static final String PARAM_MEDIAWIKIUSER = "-mu"; - public static final String PARAM_MEDIAWIKIPASSWORD = "-mp"; - public static final String PARAM_GITHUBAPI = "-gapi"; - - private static String systemOutPrintln; - private static boolean recordSystemOutPrintln; - - public static void main(String args[]) throws Exception { - Settings defaultSettings = defaultSettings(); - Argument helpArgument = helpArgument("-h", "--help"); - - Argument settingsArgument = stringArgument(PARAM_SETTINGS_FILE, "--settings-file")// - .description("Use settings from file.")// - .defaultValue(null) // - .build(); - Argument outputStdoutArgument = optionArgument(PARAM_OUTPUT_STDOUT, "--stdout")// - .description("Print builder to .")// - .build(); - Argument outputFileArgument = stringArgument(PARAM_OUTPUT_FILE, "--output-file")// - .description("Write output to file.")// - .build(); - - Argument templatePathArgument = stringArgument(PARAM_TEMPLATE, "--template")// - .description("Template to use. A default template will be used if not specified.")// - .defaultValue(defaultSettings.getTemplatePath())// - .build(); - - Argument untaggedTagNameArgument = stringArgument(PARAM_UNTAGGED_TAG_NAME, "--untagged-name")// - .description( - "When listing commits per tag, this will by the name of a virtual tag that contains commits not available in any git tag.")// - .defaultValue(defaultSettings.getUntaggedName())// - .build(); - - Argument fromRepoArgument = stringArgument(PARAM_REPO, "--repo")// - .description("Repository.")// - .defaultValue(defaultSettings.getFromRepo())// - .build(); - Argument fromRefArgument = stringArgument(PARAM_FROM_REF, "--from-ref")// - .description("From ref.")// - .defaultValue(defaultSettings.getFromRef().orNull())// - .build(); - Argument toRefArgument = stringArgument(PARAM_TO_REF, "--to-ref")// - .description("To ref.")// - .defaultValue(defaultSettings.getToRef().orNull())// - .build(); - Argument fromCommitArgument = stringArgument(PARAM_FROM_COMMIT, "--from-commit")// - .description("From commit.")// - .defaultValue(defaultSettings.getFromCommit().orNull())// - .build(); - Argument toCommitArgument = stringArgument(PARAM_TO_COMMIT, "--to-commit")// - .description("To commit.")// - .defaultValue(defaultSettings.getToCommit().orNull())// - .build(); - - Argument ignoreCommitsIfMessageMatchesArgument = stringArgument(PARAM_IGNORE_PATTERN, "--ignore-pattern")// - .description("Ignore commits where pattern matches message.")// - .defaultValue(defaultSettings.getIgnoreCommitsIfMessageMatches())// - .build(); - - Argument jiraServerArgument = stringArgument(PARAM_JIRA_SERVER, "--jiraServer")// - .description("Jira server. When a Jira server is given, the title of the Jira issues can be used in the changelog.")// - .defaultValue(defaultSettings.getJiraServer().orNull())// - .build(); - Argument jiraIssuePatternArgument = stringArgument(PARAM_JIRA_ISSUE_PATTERN, "--jira-pattern")// - .description("Jira issue pattern.")// - .defaultValue(defaultSettings.getJiraIssuePattern())// - .build(); - Argument jiraUsernamePatternArgument = stringArgument(PARAM_JIRA_USERNAME, "--jira-username")// - .description("Optional username to authenticate with Jira.")// - .defaultValue(defaultSettings.getJiraIssuePattern())// - .build(); - Argument jiraPasswordPatternArgument = stringArgument(PARAM_JIRA_PASSWORD, "--jira-password")// - .description("Optional password to authenticate with Jira.")// - .defaultValue(defaultSettings.getJiraIssuePattern())// - .build(); - - Argument customIssueNameArgument = stringArgument(PARAM_CUSTOM_ISSUE_NAME, "--custom-issue-name")// - .description("Custom issue name.")// - .defaultValue(null)// - .build(); - Argument customIssuePatternArgument = stringArgument(PARAM_CUSTOM_ISSUE_PATTERN, "--custom-issue-pattern")// - .description("Custom issue pattern.")// - .defaultValue(null)// - .build(); - Argument customIssueLinkArgument = stringArgument(PARAM_CUSTOM_ISSUE_LINK, "--custom-issue-link")// - .description("Custom issue link.")// - .defaultValue(null)// - .build(); - - Argument timeZoneArgument = stringArgument(PARAM_TIMEZONE, "--time-zone")// - .description("TimeZone to use when printing dates.")// - .defaultValue(defaultSettings.getTimeZone())// - .build(); - Argument dateFormatArgument = stringArgument(PARAM_DATEFORMAT, "--date-format")// - .description("Format to use when printing dates.")// - .defaultValue(defaultSettings.getDateFormat())// - .build(); - Argument noIssueArgument = stringArgument(PARAM_NOISSUE, "--no-issue-name")// - .description("Name of virtual issue that contains commits that has no issue associated.")// - .defaultValue(defaultSettings.getNoIssueName())// - .build(); - Argument readableTagNameArgument = stringArgument(PARAM_READABLETAGNAME, "--readable-tag-name")// - .description("Pattern to extract readable part of tag.")// - .defaultValue(defaultSettings.getReadableTagName())// - .build(); - Argument removeIssueFromMessageArgument = optionArgument(PARAM_REMOVEISSUE, "--remove-issue-from-message")// - .description("Dont print any issues in the messages of commits.")// - .build(); - - Argument mediaWikiUrlArgument = stringArgument(PARAM_MEDIAWIKIURL, "--mediawiki-url")// - .description("Base URL of MediaWiki.")// - .build(); - Argument mediaWikiTitleArgument = stringArgument(PARAM_MEDIAWIKITITLE, "--mediawiki-title")// - .description("Title of MediaWiki page.")// - .defaultValue(null) // - .build(); - Argument mediaWikiUserArgument = stringArgument(PARAM_MEDIAWIKIUSER, "--mediawiki-user")// - .description("User to authenticate with MediaWiki.")// - .defaultValue("") // - .build(); - Argument mediaWikiPasswordArgument = stringArgument(PARAM_MEDIAWIKIPASSWORD, "--mediawiki-password")// - .description("Password to authenticate with MediaWiki.")// - .defaultValue("") // - .build(); - Argument gitHubApiArgument = stringArgument(PARAM_GITHUBAPI, "--github-api")// - .description("GitHub API.")// - .defaultValue("") // - .build(); - - try { - ParsedArguments arg = withArguments(helpArgument, settingsArgument, outputStdoutArgument, outputFileArgument, - templatePathArgument, fromCommitArgument, fromRefArgument, fromRepoArgument, toCommitArgument, toRefArgument, - untaggedTagNameArgument, jiraIssuePatternArgument, jiraServerArgument, ignoreCommitsIfMessageMatchesArgument, - customIssueLinkArgument, customIssueNameArgument, customIssuePatternArgument, timeZoneArgument, - dateFormatArgument, noIssueArgument, readableTagNameArgument, removeIssueFromMessageArgument, - mediaWikiUrlArgument, mediaWikiUserArgument, mediaWikiPasswordArgument, mediaWikiTitleArgument, gitHubApiArgument, - jiraUsernamePatternArgument, jiraPasswordPatternArgument)// - .parse(args); - - GitChangelogApi changelogApiBuilder = gitChangelogApiBuilder(); - - if (arg.wasGiven(removeIssueFromMessageArgument)) { - changelogApiBuilder.withRemoveIssueFromMessageArgument(true); - } - - if (arg.wasGiven(settingsArgument)) { - changelogApiBuilder.withSettings(new File(arg.get(settingsArgument)).toURI().toURL()); - } - if (arg.wasGiven(fromRepoArgument)) { - changelogApiBuilder.withFromRepo(arg.get(fromRepoArgument)); - } - if (arg.wasGiven(untaggedTagNameArgument)) { - changelogApiBuilder.withUntaggedName(arg.get(untaggedTagNameArgument)); - } - if (arg.wasGiven(ignoreCommitsIfMessageMatchesArgument)) { - changelogApiBuilder.withIgnoreCommitsWithMesssage(arg.get(ignoreCommitsIfMessageMatchesArgument)); - } - if (arg.wasGiven(templatePathArgument)) { - changelogApiBuilder.withTemplatePath(arg.get(templatePathArgument)); - } - if (arg.wasGiven(jiraIssuePatternArgument)) { - changelogApiBuilder.withJiraIssuePattern(arg.get(jiraIssuePatternArgument)); - } - if (arg.wasGiven(jiraServerArgument)) { - changelogApiBuilder.withJiraServer(arg.get(jiraServerArgument)); - } - if (arg.wasGiven(jiraUsernamePatternArgument)) { - changelogApiBuilder.withJiraUsername(arg.get(jiraUsernamePatternArgument)); - } - if (arg.wasGiven(jiraPasswordPatternArgument)) { - changelogApiBuilder.withJiraPassword(arg.get(jiraPasswordPatternArgument)); - } - if (arg.wasGiven(timeZoneArgument)) { - changelogApiBuilder.withTimeZone(arg.get(timeZoneArgument)); - } - if (arg.wasGiven(dateFormatArgument)) { - changelogApiBuilder.withDateFormat(arg.get(dateFormatArgument)); - } - if (arg.wasGiven(noIssueArgument)) { - changelogApiBuilder.withNoIssueName(arg.get(noIssueArgument)); - } - if (arg.wasGiven(readableTagNameArgument)) { - changelogApiBuilder.withReadableTagName(arg.get(readableTagNameArgument)); - } - - if (arg.wasGiven(fromCommitArgument)) { - changelogApiBuilder.withFromCommit(arg.get(fromCommitArgument)); - changelogApiBuilder.withFromRef(null); - } - if (arg.wasGiven(fromRefArgument)) { - changelogApiBuilder.withFromCommit(null); - changelogApiBuilder.withFromRef(arg.get(fromRefArgument)); - } - if (arg.wasGiven(toCommitArgument)) { - changelogApiBuilder.withToCommit(arg.get(toCommitArgument)); - changelogApiBuilder.withToRef(null); - } - if (arg.wasGiven(toRefArgument)) { - changelogApiBuilder.withToCommit(null); - changelogApiBuilder.withToRef(arg.get(toRefArgument)); - } - if (arg.wasGiven(gitHubApiArgument)) { - changelogApiBuilder.withGitHubApi(arg.get(gitHubApiArgument)); - } - - if ( // - arg.wasGiven(customIssueNameArgument) && // - arg.wasGiven(customIssuePatternArgument) && // - arg.wasGiven(customIssueLinkArgument)) { - changelogApiBuilder.withCustomIssue(// - arg.get(customIssueNameArgument),// - arg.get(customIssuePatternArgument),// - arg.get(customIssueLinkArgument)); - } - - checkArgument(// - arg.wasGiven(outputStdoutArgument) || arg.wasGiven(outputFileArgument) || arg.wasGiven(mediaWikiUrlArgument),// - "You must supply an output, " + PARAM_OUTPUT_FILE + " , " + PARAM_OUTPUT_STDOUT + " or " - + PARAM_MEDIAWIKIURL + " http://..."); - - if (arg.wasGiven(mediaWikiUrlArgument)) { - changelogApiBuilder// - .toMediaWiki(// - arg.get(mediaWikiUserArgument), // - arg.get(mediaWikiPasswordArgument),// - arg.get(mediaWikiUrlArgument), // - arg.get(mediaWikiTitleArgument));// - } - - if (arg.wasGiven(outputStdoutArgument)) { - systemOutPrintln(changelogApiBuilder.render()); - } - - if (arg.wasGiven(outputFileArgument)) { - String filePath = arg.get(outputFileArgument); - changelogApiBuilder.toFile(filePath); - } - - } catch (ArgumentException exception) { - System.out.println(exception.getMessageAndUsage()); - System.exit(1); - } - } - - @VisibleForTesting - public static String getSystemOutPrintln() { - return Main.systemOutPrintln; - } - - @VisibleForTesting - public static void recordSystemOutPrintln() { - Main.recordSystemOutPrintln = true; - } - - private static void systemOutPrintln(String systemOutPrintln) { - if (Main.recordSystemOutPrintln) { - Main.systemOutPrintln = systemOutPrintln; - } else { - System.out.println(systemOutPrintln); - } - } -} diff --git a/src/test/java/se/bjurr/gitchangelog/api/GitChangelogApiAsserter.java b/src/test/java/se/bjurr/gitchangelog/api/GitChangelogApiAsserter.java index f7fb1593..2bd41c63 100644 --- a/src/test/java/se/bjurr/gitchangelog/api/GitChangelogApiAsserter.java +++ b/src/test/java/se/bjurr/gitchangelog/api/GitChangelogApiAsserter.java @@ -1,21 +1,14 @@ package se.bjurr.gitchangelog.api; import static com.google.common.base.Charsets.UTF_8; -import static com.google.common.collect.Lists.newArrayList; import static com.google.common.io.Resources.getResource; import static org.junit.Assert.assertEquals; import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder; import static se.bjurr.gitchangelog.api.GitChangelogApi.setFakeGitRepo; import static se.bjurr.gitchangelog.api.GitChangelogApiConstants.REF_MASTER; import static se.bjurr.gitchangelog.api.GitChangelogApiConstants.ZERO_COMMIT; -import static se.bjurr.gitchangelog.main.Main.PARAM_OUTPUT_STDOUT; -import static se.bjurr.gitchangelog.main.Main.PARAM_SETTINGS_FILE; -import static se.bjurr.gitchangelog.main.Main.PARAM_TEMPLATE; import java.net.URL; -import java.util.List; - -import se.bjurr.gitchangelog.main.Main; import com.google.common.io.Resources; @@ -78,16 +71,5 @@ public void rendersTo(String file) throws Exception { .withTemplatePath(templatePath) // .render() // .trim()); - - // Test main - List argList = newArrayList(// - PARAM_SETTINGS_FILE, settingsFile.getFile(), // - PARAM_TEMPLATE, templatePath,// - PARAM_OUTPUT_STDOUT// - ); - Main.recordSystemOutPrintln(); - String[] args = new String[argList.size()]; - Main.main(argList.toArray(args)); - assertEquals("With Main: " + file, expected, Main.getSystemOutPrintln().trim()); } }