Skip to content

Commit

Permalink
Small fix to make project creation work
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-wyluda committed Aug 20, 2013
1 parent cef0a0c commit e1c980b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public boolean install()
if (!getBuildScriptResource().exists())
{
getBuildScriptResource().createNewFile();
getBuildScriptResource().setContents("apply plugin: 'java'\n");
}
if (!getSettingsScriptResource().exists())
{
Expand Down Expand Up @@ -197,7 +198,8 @@ private void checkIfIsForgeLibraryInstalled()
{
getBuildScriptResource().setContents(newScript);

FileResource<?> forgeLib = getFaceted().getProjectRoot().getChildDirectory(GradleSourceUtil.FORGE_LIBRARY);
FileResource<?> forgeLib = (FileResource<?>)
getFaceted().getProjectRoot().getChild(GradleSourceUtil.FORGE_LIBRARY);
forgeLib.setContents(getClass().getResourceAsStream(GradleSourceUtil.FORGE_LIBRARY_RESOURCE));
}
}
Expand Down
44 changes: 23 additions & 21 deletions impl/src/main/resources/forge.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,27 +191,29 @@ allprojects {
}
outputDec '</plugins>'
outputInc '<sourceSets>'
p.sourceSets.each { set ->
outputInc '<sourceSet>'
outputInc '<name>'
output set.name
outputDec '</name>'
outputInc '<java>'
set.java.srcDirs.each {
outputInc '<directory>'
outputRelative(it, project.projectDir)
outputDec '</directory>'
}
outputDec '</java>'
outputInc '<resources>'
set.resources.srcDirs.each {
outputInc '<directory>'
outputRelative(it, project.projectDir)
outputDec '</directory>'
}
outputDec '</resources>'
outputDec '</sourceSet>'
}
if (p.hasProperty('sourceSets')) {
p.sourceSets.each { set ->
outputInc '<sourceSet>'
outputInc '<name>'
output set.name
outputDec '</name>'
outputInc '<java>'
set.java.srcDirs.each {
outputInc '<directory>'
outputRelative(it, project.projectDir)
outputDec '</directory>'
}
outputDec '</java>'
outputInc '<resources>'
set.resources.srcDirs.each {
outputInc '<directory>'
outputRelative(it, project.projectDir)
outputDec '</directory>'
}
outputDec '</resources>'
outputDec '</sourceSet>'
}
}
outputDec '</sourceSets>'
outputDec '</project>'
}
Expand Down

0 comments on commit e1c980b

Please sign in to comment.