From e68da8942755daeceb964e8ac6e82474d39cd22a Mon Sep 17 00:00:00 2001 From: Stefan Oehme Date: Wed, 4 Jul 2018 17:55:44 +0200 Subject: [PATCH] Revert "#83 Relatives path of OutputConfiguration and add test case." --- .../gradle/builder/XtextGradleBuilder.xtend | 4 +-- .../BuildingAMultiModuleXtendProject.xtend | 36 ------------------- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend b/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend index 9b02d763..79597b45 100644 --- a/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend +++ b/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend @@ -9,7 +9,6 @@ import com.google.inject.Guice import java.io.Closeable import java.io.File import java.net.URLClassLoader -import java.nio.file.Paths import java.util.List import java.util.Set import java.util.concurrent.ConcurrentHashMap @@ -251,8 +250,7 @@ class XtextGradleBuilder implements IncrementalXtextBuilder { gradleRequest.generatorConfigsByLanguage.mapValues[ outputConfigs.map[gradleOutputConfig| new OutputConfiguration(gradleOutputConfig.outletName) => [ - outputDirectory = Paths.get(gradleRequest.projectDir.absolutePath).relativize(Paths.get( - gradleOutputConfig.target.absolutePath)).toString + outputDirectory = gradleOutputConfig.target.absolutePath ] ].toSet ] diff --git a/xtext-gradle-plugin/src/integTest/java/org/xtext/gradle/test/BuildingAMultiModuleXtendProject.xtend b/xtext-gradle-plugin/src/integTest/java/org/xtext/gradle/test/BuildingAMultiModuleXtendProject.xtend index f62ac252..024851d8 100644 --- a/xtext-gradle-plugin/src/integTest/java/org/xtext/gradle/test/BuildingAMultiModuleXtendProject.xtend +++ b/xtext-gradle-plugin/src/integTest/java/org/xtext/gradle/test/BuildingAMultiModuleXtendProject.xtend @@ -62,40 +62,4 @@ class BuildingAMultiModuleXtendProject extends AbstractXtendIntegrationTest { result.hasRunGeneratorFor(downStream) } - @Test - def void activeAnnotationsCanGenerateFilesUsingOutputConfigurations() { - upStreamProject.createFile('src/main/java/com/example/Generate.xtend', ''' - package com.example - import java.util.List - import org.eclipse.xtend.lib.macro.AbstractClassProcessor - import org.eclipse.xtend.lib.macro.CodeGenerationContext - import org.eclipse.xtend.lib.macro.declaration.ClassDeclaration - class GenerateProcessor extends AbstractClassProcessor { - override doGenerateCode(List annotatedSourceElements, extension CodeGenerationContext context) { - for (clazz : annotatedSourceElements) { - val filePath = clazz.compilationUnit.filePath - val folder = context.getTargetFolder(filePath) - val file = folder.append("Test.info") - file.contents = clazz.getSimpleName - } - } - } - ''') - upStreamProject.createFile('src/main/java/com/example/GenerateProcessor.xtend', ''' - package com.example - import org.eclipse.xtend.lib.macro.Active - @Active(GenerateProcessor) - annotation Generate {} - ''') - downStreamProject.createFile('src/main/java/com/example/HelloWorld.xtend', ''' - package com.example - @Generate - class HelloWorld {} - ''') - - build('build') - - file('downStream/build/xtend/main/Test.info').shouldExist - } - } \ No newline at end of file