Created
July 17, 2012 15:02
gradle-gitignore-plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
archivesBaseName = 'gradle-git-ignore' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mikeneck.gradle.git | |
import org.gradle.api.Project | |
import org.gradle.api.Plugin | |
import org.gradle.api.plugins.PluginContainer | |
/** | |
* git-ignore task | |
* | |
* @author mike_neck | |
*/ | |
class GitIgnorePlugin implements Plugin<Project> { | |
private static final String GIT_IGNORE = '.gitignore' | |
@Override | |
void apply(Project project) { | |
project.task('git-ignore').doLast { | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
apply plugin : 'groovy' | |
apply plugin : 'idea' | |
group = 'org.mikeneck.gradle.git' | |
version = '0.1' | |
def jdkLevel = 1.6 | |
sourceCompatibility = jdkLevel | |
targetCompatibility = jdkLevel | |
repositories { | |
mavenCentral () | |
} | |
dependencies { | |
testCompile ('junit:junit-dep:4.+') { | |
exclude module : 'hamcrest' | |
exclude module : 'hamcrest-core' | |
} | |
testCompile 'org.hamcrest:hamcrest-library:1.2.1' | |
testCompile 'org.easymock:easymock:3.1' | |
testCompile 'org.powermock:powermock-api-easymock:1.4.12' | |
testCompile ('org.powermock:powermock-module-junit4:1.4.12') { | |
exclude module : 'junit' | |
} | |
} | |
} | |
project (':core') { | |
dependencies { | |
groovy fileTree(dir: new File(gradle.gradleHomeDir, 'lib'), includes: ['**/groovy-all-*.jar']) | |
compile gradleApi() | |
} | |
} | |
idea.project.ipr { | |
withXml { provider -> | |
def map = provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping | |
map.@vcs = 'Git' | |
map.@directory = project.properties.projectDir | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
dependencies { | |
classpath files ("../core/build/libs/gradle-git-ignore-${project.properties['version']}.jar") | |
} | |
} | |
if (new File("../core/build/libs/gradle-git-ignore-${project.properties['version']}.jar").exists()) { | |
apply plugin : 'git-ignore' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment