From dd074ec6b90aeb8464cfea6f21a9ac4fcfc9a9c3 Mon Sep 17 00:00:00 2001 From: Guilherme I F L Weizenmann Date: Wed, 12 Aug 2015 23:15:00 -0300 Subject: [PATCH] Migrate to Maven from Gradle --- .hgflow | 8 - .hgignore | 4 - .idea/.name | 1 - .idea/ant.xml | 3 - .idea/codeStyleSettings.xml | 14 - .idea/compiler.xml | 25 -- .idea/copyright/Apache___OZC.xml | 9 - .idea/copyright/profiles_settings.xml | 7 - .idea/cssxfire.xml | 9 - .idea/encodings.xml | 5 - .idea/gradle.xml | 18 -- .idea/gradle_settings2_config.xml | 32 --- .idea/inspectionProfiles/Project_Default.xml | 130 --------- .../inspectionProfiles/profiles_settings.xml | 7 - .idea/misc.xml | 36 --- .idea/modules.xml | 9 - .idea/projectCodeStyle.xml | 40 --- .idea/scopes/Non_Resource_Files.xml | 3 - .idea/scopes/scope_settings.xml | 5 - .idea/uiDesigner.xml | 125 -------- .idea/vcs.xml | 8 - Remark.iml | 22 -- build.gradle | 268 ------------------ gradle.properties | 7 - pom-draft.xml => pom.xml | 0 25 files changed, 795 deletions(-) delete mode 100644 .hgflow delete mode 100644 .hgignore delete mode 100644 .idea/.name delete mode 100644 .idea/ant.xml delete mode 100644 .idea/codeStyleSettings.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/Apache___OZC.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/cssxfire.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/gradle_settings2_config.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/projectCodeStyle.xml delete mode 100644 .idea/scopes/Non_Resource_Files.xml delete mode 100644 .idea/scopes/scope_settings.xml delete mode 100644 .idea/uiDesigner.xml delete mode 100644 .idea/vcs.xml delete mode 100644 Remark.iml delete mode 100644 build.gradle delete mode 100644 gradle.properties rename pom-draft.xml => pom.xml (100%) diff --git a/.hgflow b/.hgflow deleted file mode 100644 index f1e0e94..0000000 --- a/.hgflow +++ /dev/null @@ -1,8 +0,0 @@ -[branchname] -master = default -develop = develop -feature = feature/ -release = release/ -hotfix = hotfix/ -support = support/ - diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 3f3a090..0000000 --- a/.hgignore +++ /dev/null @@ -1,4 +0,0 @@ -glob:build/* -.idea/workspace.xml -.gradle/* -.idea/libraries/Gradle_* diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 0a941dd..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -remark \ No newline at end of file diff --git a/.idea/ant.xml b/.idea/ant.xml deleted file mode 100644 index f6e673a..0000000 --- a/.idea/ant.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index c4deb56..0000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index b22c943..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - diff --git a/.idea/copyright/Apache___OZC.xml b/.idea/copyright/Apache___OZC.xml deleted file mode 100644 index 981e557..0000000 --- a/.idea/copyright/Apache___OZC.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 2167962..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/cssxfire.xml b/.idea/cssxfire.xml deleted file mode 100644 index 6f37fbd..0000000 --- a/.idea/cssxfire.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 2f7f278..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/.idea/gradle_settings2_config.xml b/.idea/gradle_settings2_config.xml deleted file mode 100644 index 1271872..0000000 --- a/.idea/gradle_settings2_config.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 411fa63..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b31283..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index a504523..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - http://www.w3.org/1999/xhtml - - - - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index f79f56a..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/.idea/projectCodeStyle.xml b/.idea/projectCodeStyle.xml deleted file mode 100644 index 6459011..0000000 --- a/.idea/projectCodeStyle.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - diff --git a/.idea/scopes/Non_Resource_Files.xml b/.idea/scopes/Non_Resource_Files.xml deleted file mode 100644 index 785f0a2..0000000 --- a/.idea/scopes/Non_Resource_Files.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 3b00020..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 9dc6764..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/Remark.iml b/Remark.iml deleted file mode 100644 index 9a5907d..0000000 --- a/Remark.iml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 3052948..0000000 --- a/build.gradle +++ /dev/null @@ -1,268 +0,0 @@ -apply plugin: 'java' -apply plugin: 'maven' - -//apply plugin: com.smokejumperit.gradle.OneJarPlugin - -//--------------------------------------------------------------------------- -// Base properties -//--------------------------------------------------------------------------- - -targetCompatibility = 1.5 -sourceCompatibility = 1.5 - -//--------------------------------------------------------------------------- -// Dependencies -//--------------------------------------------------------------------------- -buildscript { - repositories { - mavenCentral() - //mavenRepo url:'http://repo.smokejumperit.com' - } - dependencies { - //classpath group: 'com.smokejumperit', name: 'gradle-plugins', version: '0.8.2' - classpath group: 'org.pegdown', name: 'pegdown', version: '1.5.0' - } -} - -repositories { - mavenCentral() -} - -dependencies { - compile group: 'org.jsoup', name: 'jsoup', version: '1.6.3' - compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4' - compile group: 'commons-cli', name: 'commons-cli', version: '1.2' - testCompile group: 'junit', name: 'junit', version: '4.12' - testCompile group: 'commons-io', name: 'commons-io', version: '2.4' -} -//--------------------------------------------------------------------------- -// POM -//--------------------------------------------------------------------------- -task pom(description: 'Generate pom based on gradle build script') << { - pom { - project { - groupId 'com.overzealous' - artifactId 'remark' - inceptionYear '2011' - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0' - distribution 'repo' - } - } - } - }.writeTo("$projectDir/pom.xml") -} -//--------------------------------------------------------------------------- -// Override default tasks -//--------------------------------------------------------------------------- -jar { - manifest { - attributes 'Main-Class': 'com.overzealous.remark.Main' - } -} - -javadoc { - configure(options) { - options.links = [ 'http://download.oracle.com/javase/6/docs/api/', 'http://jsoup.org/apidocs/' ] - options.author = true - options.bottom = '
© 2011 OverZealous Creations, LLC - BitBucket Repository
' - } -} - - - -//--------------------------------------------------------------------------- -// Custom tasks -//--------------------------------------------------------------------------- - -task copyManualHtAccess(type: Copy) { - from 'src/manual/' - into 'build/docs/' - include '.htaccess' -} - -task copyManualFiles(type: Copy) { - from 'src/manual/' - into 'build/docs/manual/' - exclude '*.md' - exclude '*.htaccess' - exclude '_template.html' - //include 'css/**' - //include 'images/**' - //include 'js/**' - //include '.htaccess' - //include 'favicon.ico' - //include 'apple-touch*.*' -} - -/*task createManual(dependsOn: [javadoc, copyManualHtAccess, copyManualFiles], description: "Converts the markdown manual to HTML for deployment") { - group = 'Documentation' - //templateFile = file('src/manual/_template.html') - srcFiles = files { file('src/manual').listFiles().findAll{ it.name.endsWith('.md') } } - destDir = file('build/docs/manual') - inputs.files srcFiles, templateFile - //outputs.dir destDir - doLast { - String template = file('src/manual/_template.html').text - def keyword = ~/\$\{([\-a-z]+)\}/ - templateMe = { String filename, String body, String title = null -> - def props = [ - title: 'Remark Manual', - body: body, - pageclass: filename - ] - if(title != null) { - props.title = "${props.title} - $title".toString() - } - - template.replaceAll(keyword) { m, kw -> - props[kw] ?: (filename == kw ? ' selected' : '') - } - } - def pd = new org.pegdown.PegDownProcessor(org.pegdown.Extensions.ALL); - srcFiles.each{ File mdFile -> - String htmlFileName = mdFile.name.replace('.md', '.html') - File dest = file(new File(htmlFileName, destDir)) - if(dest.exists() && (!dest.isFile() || !dest.canWrite())) { - throw new Exception("Unable to write to destination: $dest. Please run gradle clean before continuing") - } - if(!dest.isFile() || - dest.lastModified() < mdFile.lastModified() || - dest.lastModified() < templateFile.lastModified()) { - String input = mdFile.getText('UTF-8') - String title = null; - if(input.startsWith('#')) { - def titleMatch = (input =~ /#++([^\n#]+)/) - if(titleMatch.find()) { - title = titleMatch[0][1].trim() - } - } - def out = pd.markdownToHtml(input) - dest.setText(templateMe(mdFile.name.replace('.md', ''), out, title), 'UTF-8') - } - } - } -}*/ -/*task buildDist(dependsOn: [build, createManual, oneJar], description: "Builds everything.") { - group = 'Distribution' -}*/ -if(gradle.startParameter.taskNames.any{ it == 'cleanBuildDist' || it == 'cBD' }) { - compileJava.dependsOn clean -} -/*task cleanBuildDist(dependsOn: [buildDist], description: "Cleans and builds everything.") { - group = 'Distribution' -}*/ - -uploadArchives { - repositories { - mavenDeployer { - repository(url: "file://localhost/~/mvnTemp") - pom.whenConfigured { pomToConfigure -> - pomToConfigure.project { - description project.description - url project.url - licenses { - license { - name project.licenseName - url project.licenseUrl - } - } - developers { - developer { - id "OverZealous" - name "Phil DeJarnett" - email "phil@overzealous.com" - } - } - scm { - url project.scmUrl - } - } - } - } - } -} - -task bumpVersion(description: 'Bumps the app Version for release.') << { - //noinspection GroovyAssignabilityCheck - def components = version.split('\\.').collect { Integer.parseInt(it.replace('-SNAPSHOT', ''))} - components[2] += 1 - def nextIntegrationVersion = components.join('.')+"-SNAPSHOT" - println "Bumping $version to $nextIntegrationVersion" - def newProps = file("gradle.properties").text.replace(version, nextIntegrationVersion) - file("gradle.properties").text = newProps -} - -task intellijSync(description: 'Add gradle dependecies to IntelliJ project library') << { - - // Add source and javadoc artifacts - configurations.each{ - it.dependencies.each { dep -> - ['jar':null,'source':'sources','javadoc':'javadoc'].each{arType, arClassifier -> - dep.artifact { - name = dep.name - extension = 'jar' - type = arType - classifier = arClassifier - } - } - } - } - - final def librariesDir = new File(".idea${File.separator}libraries") - librariesDir.mkdirs() - - final def userHomeGradle = project.gradle.gradleUserHomeDir - if(!userHomeGradle) { - println "Set the USER_HOME_GRADLE variable to '$userHomeGradle.path'" - } - - def makeJarList = { path -> - //noinspection GroovyAssignabilityCheck - path.split(File.pathSeparator).collect { - it.replaceAll userHomeGradle.path, "\\\$USER_HOME_GRADLE\\\$" - } - } - final def compileJars = makeJarList(configurations.compile.asPath) - final def testJars = makeJarList(configurations.testCompile.asPath) - compileJars - - def createLibrary = { String fileName, String libraryName, jars -> - final def gradleLibXml = new File(librariesDir, fileName) - gradleLibXml.write """ - - -""" - final def xmlRoot = new XmlParser().parse(gradleLibXml) - final def classesNode = xmlRoot.library[0].appendNode('CLASSES') - final def sourcesNode = xmlRoot.library[0].appendNode('SOURCES') - final def javadocNode = xmlRoot.library[0].appendNode('JAVADOC') - - println "Creating $libraryName"; - - jars.each { jar -> - def type; - if(jar ==~ /.*-sources\.jar$/) { - type = 'sources'; - sourcesNode.appendNode('root', [url: "jar://$jar!/"]) - } else if(jar ==~ /.*-javadoc\.jar$/) { - type = 'javadoc'; - javadocNode.appendNode('root', [url: "jar://$jar!/"]) - } else { - type = 'class'; - classesNode.appendNode('root', [url: "jar://$jar!/"]) - } - def jarShortName = jar.replace('$USER_HOME_GRADLE$/cache/', '') - println " - Added $type jar $jarShortName" - - } - - def writer = new StringWriter() - new XmlNodePrinter(new PrintWriter(writer)).print(xmlRoot) - gradleLibXml.write writer.toString() - println "File '${gradleLibXml.path}' updated" - } - createLibrary 'Gradle_Libraries.xml', 'Gradle Libraries', compileJars - createLibrary 'Gradle_Test_Libraries.xml', 'Gradle Test Libraries', testJars -} diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index fb03921..0000000 --- a/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -group: com.overzealous -description: A library for converting HTML into Markdown -url: http://remark.overzealous.com/ -version: 1.0.0 -licenseName: The Apache Software License, Version 2.0 -licenseUrl: http://www.apache.org/licenses/LICENSE-2.0 -scmUrl: https://bitbucket.org/OverZealous/remark diff --git a/pom-draft.xml b/pom.xml similarity index 100% rename from pom-draft.xml rename to pom.xml