diff --git a/plugins/org.eclipse.xtext.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.ide/META-INF/MANIFEST.MF index dede49ee8..e933572ad 100644 --- a/plugins/org.eclipse.xtext.ide/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.xtext.ide/META-INF/MANIFEST.MF @@ -1,12 +1,11 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName +Bundle-Name: Xtext IDE Core Bundle-SymbolicName: org.eclipse.xtext.ide;singleton:=true Bundle-Version: 2.11.0.qualifier -Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Bundle-Vendor: %providerName +Bundle-Vendor: Eclipse Xtext Require-Bundle: org.eclipse.xtext;visibility:=reexport, org.eclipse.xtend.lib, org.eclipse.core.runtime;bundle-version="3.6.0", diff --git a/plugins/org.eclipse.xtext.ide/build.gradle b/plugins/org.eclipse.xtext.ide/build.gradle new file mode 100644 index 000000000..0f1715647 --- /dev/null +++ b/plugins/org.eclipse.xtext.ide/build.gradle @@ -0,0 +1,4 @@ +dependencies { + compile project(':org.eclipse.xtext') + compile "io.typefox.lsapi:io.typefox.lsapi.services:$versions.lsapi" +} diff --git a/plugins/org.eclipse.xtext.ide/build.properties b/plugins/org.eclipse.xtext.ide/build.properties index 46cab836d..fb22229b7 100644 --- a/plugins/org.eclipse.xtext.ide/build.properties +++ b/plugins/org.eclipse.xtext.ide/build.properties @@ -2,6 +2,5 @@ source.. = src/,\ xtend-gen/ bin.includes = META-INF/,\ .,\ - plugin.properties,\ about.html src.includes = about.html diff --git a/plugins/org.eclipse.xtext.ide/plugin.properties b/plugins/org.eclipse.xtext.ide/plugin.properties deleted file mode 100644 index 94abda867..000000000 --- a/plugins/org.eclipse.xtext.ide/plugin.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -############################################################################### - -pluginName = Xtext IDE Core -providerName = Eclipse Xtext \ No newline at end of file diff --git a/plugins/org.eclipse.xtext.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.util/META-INF/MANIFEST.MF index 862acd9b6..1ed2f1b4d 100644 --- a/plugins/org.eclipse.xtext.util/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.xtext.util/META-INF/MANIFEST.MF @@ -1,11 +1,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Localization: plugin +Bundle-Name: Xtext Utility Bundle-SymbolicName: org.eclipse.xtext.util Bundle-Version: 2.11.0.qualifier Maven-Version: 2.11.0-SNAPSHOT -Bundle-Vendor: %providerName +Bundle-Vendor: Eclipse Xtext Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.xtext.util; uses:="org.eclipse.emf.ecore.resource, diff --git a/plugins/org.eclipse.xtext.util/build.gradle b/plugins/org.eclipse.xtext.util/build.gradle new file mode 100644 index 000000000..ac796b5ba --- /dev/null +++ b/plugins/org.eclipse.xtext.util/build.gradle @@ -0,0 +1,7 @@ +dependencies { + compile "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext" + compile "log4j:log4j:$versions.log4j" + compile "org.eclipse.emf:org.eclipse.emf.common:$versions.emfCommon" + compile "org.eclipse.emf:org.eclipse.emf.ecore:$versions.emfEcore" + compile "com.google.inject:guice:$versions.guice" +} diff --git a/plugins/org.eclipse.xtext.util/build.properties b/plugins/org.eclipse.xtext.util/build.properties index ab39f02e2..0ca040a19 100644 --- a/plugins/org.eclipse.xtext.util/build.properties +++ b/plugins/org.eclipse.xtext.util/build.properties @@ -3,6 +3,5 @@ source.. = src/,\ output.. = bin/ bin.includes = META-INF/,\ .,\ - plugin.properties,\ about.html src.includes = about.html diff --git a/plugins/org.eclipse.xtext.util/plugin.properties b/plugins/org.eclipse.xtext.util/plugin.properties deleted file mode 100644 index 564403f84..000000000 --- a/plugins/org.eclipse.xtext.util/plugin.properties +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -# Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -############################################################################### - -pluginName = Xtext Utility -providerName = Eclipse Xtext \ No newline at end of file diff --git a/plugins/org.eclipse.xtext.xtext.generator/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext.xtext.generator/META-INF/MANIFEST.MF index ded9cad06..120328e19 100644 --- a/plugins/org.eclipse.xtext.xtext.generator/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.xtext.xtext.generator/META-INF/MANIFEST.MF @@ -2,10 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.xtext.xtext.generator;singleton:=true Bundle-Version: 2.11.0.qualifier -Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Name: %pluginName -Bundle-Vendor: %providerName +Bundle-Name: Xtext Generator 2 +Bundle-Vendor: Eclipse Xtext Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.xtext;x-installation:=greedy, org.eclipse.xtext.util;x-installation:=greedy, diff --git a/plugins/org.eclipse.xtext.xtext.generator/build.gradle b/plugins/org.eclipse.xtext.xtext.generator/build.gradle new file mode 100644 index 000000000..445098022 --- /dev/null +++ b/plugins/org.eclipse.xtext.xtext.generator/build.gradle @@ -0,0 +1,8 @@ +dependencies { + compile project(':org.eclipse.xtext') + compile "org.eclipse.emf:org.eclipse.emf.codegen:$versions.emfEcore" + compile "org.eclipse.emf:org.eclipse.emf.codegen.ecore:$versions.emfEcore" + compile "org.eclipse.emf:org.eclipse.emf.mwe.utils:$versions.emfMwe" + compile "org.eclipse.emf:org.eclipse.emf.mwe2.lib:$versions.emfMwe2" + compile "com.ibm.icu:icu4j:$versions.icu" +} diff --git a/plugins/org.eclipse.xtext.xtext.generator/build.properties b/plugins/org.eclipse.xtext.xtext.generator/build.properties index 0fcb03bba..d17f6b241 100644 --- a/plugins/org.eclipse.xtext.xtext.generator/build.properties +++ b/plugins/org.eclipse.xtext.xtext.generator/build.properties @@ -4,6 +4,5 @@ source.. = src/,\ output.. = bin/ bin.includes = META-INF/,\ .,\ - about.html,\ - plugin.properties + about.html src.includes = about.html diff --git a/plugins/org.eclipse.xtext.xtext.generator/plugin.properties b/plugins/org.eclipse.xtext.xtext.generator/plugin.properties deleted file mode 100644 index efa72928a..000000000 --- a/plugins/org.eclipse.xtext.xtext.generator/plugin.properties +++ /dev/null @@ -1,2 +0,0 @@ -pluginName = Xtext Generator 2 -providerName = Eclipse Xtext diff --git a/plugins/org.eclipse.xtext.xtext.wizard/build.gradle b/plugins/org.eclipse.xtext.xtext.wizard/build.gradle new file mode 100644 index 000000000..e72780618 --- /dev/null +++ b/plugins/org.eclipse.xtext.xtext.wizard/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(':org.eclipse.xtext') +} diff --git a/plugins/org.eclipse.xtext/META-INF/MANIFEST.MF b/plugins/org.eclipse.xtext/META-INF/MANIFEST.MF index dd89bcb86..775bc3e62 100644 --- a/plugins/org.eclipse.xtext/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.xtext/META-INF/MANIFEST.MF @@ -1,11 +1,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName +Bundle-Name: Xtext Bundle-SymbolicName: org.eclipse.xtext;singleton:=true Bundle-Version: 2.11.0.qualifier Bundle-ClassPath: . -Bundle-Vendor: %providerName -Bundle-Localization: plugin +Bundle-Vendor: Eclipse Xtext Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.eclipse.xtext, org.eclipse.xtext.build;x-friends:="org.eclipse.xtext.ide,org.eclipse.xtext.junit4,org.eclipse.xtend.core.tests", diff --git a/plugins/org.eclipse.xtext/build.gradle b/plugins/org.eclipse.xtext/build.gradle index cc909856e..7b41eccb1 100644 --- a/plugins/org.eclipse.xtext/build.gradle +++ b/plugins/org.eclipse.xtext/build.gradle @@ -1,3 +1,22 @@ dependencies { - compile project(':plugins:org.eclipse.xtext.smap') -} \ No newline at end of file + compile project(':org.eclipse.xtext.util') + compile project(':org.eclipse.xtext.smap') // TODO eliminate dependency + compile "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext" + compile "log4j:log4j:$versions.log4j" + compile "org.eclipse.equinox:org.eclipse.equinox.common:$versions.equinoxCommon" + compile "org.eclipse.emf:org.eclipse.emf.common:$versions.emfCommon" + compile "org.eclipse.emf:org.eclipse.emf.ecore.xmi:$versions.emfEcore" + compile "com.google.inject:guice:$versions.guice" + compile "org.antlr:antlr-runtime:$versions.antlr" + optional "org.eclipse.core:org.eclipse.core.runtime:$versions.eclipseCore" + optional "org.eclipse.equinox:org.eclipse.equinox.registry:$versions.equinoxRegistry" + optional "org.eclipse.emf:org.eclipse.emf.mwe.utils:$versions.emfMwe" + optional "org.eclipse.xpand:org.eclipse.xtend:$versions.xpand" + optional "org.eclipse.xpand:org.eclipse.xtend.typesystem.emf:$versions.xpand" + optional "org.ow2.asm:asm-commons:$versions.asm" +} + +sourceSets.main { + java.srcDir 'packrat' + resources.include 'org/**', 'modeling32.png' +} diff --git a/plugins/org.eclipse.xtext/build.properties b/plugins/org.eclipse.xtext/build.properties index 39070892b..e373956c8 100644 --- a/plugins/org.eclipse.xtext/build.properties +++ b/plugins/org.eclipse.xtext/build.properties @@ -2,7 +2,6 @@ bin.includes = .,\ schema/,\ META-INF/,\ plugin.xml,\ - plugin.properties,\ about.ini,\ about.mappings,\ about.properties,\ diff --git a/plugins/org.eclipse.xtext/plugin.properties b/plugins/org.eclipse.xtext/plugin.properties deleted file mode 100644 index 557cb388b..000000000 --- a/plugins/org.eclipse.xtext/plugin.properties +++ /dev/null @@ -1,20 +0,0 @@ - -# -# -# -# $Id: plugin.properties,v 1.5 2010/03/10 14:04:27 sefftinge Exp $ - -# ==================================================================== -# To code developer: -# Do NOT change the properties between this line and the -# "%%% END OF TRANSLATED PROPERTIES %%%" line. -# Make a new property name, append to the end of the file and change -# the code to use the new property. -# ==================================================================== - -# ==================================================================== -# %%% END OF TRANSLATED PROPERTIES %%% -# ==================================================================== - -pluginName = Xtext -providerName = Eclipse Xtext diff --git a/separate-builds/core/build.gradle b/separate-builds/core/build.gradle new file mode 100644 index 000000000..314ea3f9b --- /dev/null +++ b/separate-builds/core/build.gradle @@ -0,0 +1,15 @@ +subprojects { + repositories { + jcenter() + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots' + } + } + + apply plugin: 'java' + apply from: "${rootDir}/gradle/versions.gradle" + apply from: "${rootDir}/gradle/eclipse-project-layout.gradle" + apply from: "${rootDir}/gradle/java-compiler-settings.gradle" + + group = 'org.eclipse.xtext' +} diff --git a/separate-builds/core/gradle/eclipse-project-layout.gradle b/separate-builds/core/gradle/eclipse-project-layout.gradle new file mode 100644 index 000000000..4559c95f9 --- /dev/null +++ b/separate-builds/core/gradle/eclipse-project-layout.gradle @@ -0,0 +1,29 @@ +/* + * Since we use the Eclipse Style layout where sources and resources + * live in the same folders, we need to make some adjustments to Gradle' + * defaults. + */ + +def isTestProject = name.endsWith('tests') + +sourceSets { + configure(isTestProject? test : main) { + java.srcDirs = ['src', 'xtend-gen', 'src-gen', 'emf-gen'] + resources { + srcDirs = ['src', 'src-gen', 'emf-gen', '.'] + include 'plugin.xml', 'schema/**', 'about.ini', 'about.mappings', 'about.properties', 'about.html' + exclude '**/*._trace', '**/*.xtendbin', '**/*.xtend' + exclude 'src', 'xtend-gen', 'src-gen', 'emf-gen', 'build', 'target' + } + } + configure(isTestProject? main : test) { + java.srcDirs = [] + resources.srcDirs = [] + } +} + +jar { + metaInf { + from 'META-INF' + } +} diff --git a/separate-builds/core/gradle/java-compiler-settings.gradle b/separate-builds/core/gradle/java-compiler-settings.gradle new file mode 100644 index 000000000..dd2a8469c --- /dev/null +++ b/separate-builds/core/gradle/java-compiler-settings.gradle @@ -0,0 +1,24 @@ +plugins.withType(JavaBasePlugin) { + sourceCompatibility = '1.8' +} + +tasks.withType(JavaCompile) { + options.encoding = 'ISO-8859-1' +} + +configurations { + optional { + description 'Dependencies required at build time, but not exported into meta data' + extendsFrom compile + } + + /* + * Put any unwanted transitive dependencies here, they will be excluded from all projects + */ + all { + exclude group: 'org.antlr', module: 'stringtemplate' + exclude module: 'cglib' + } +} + +sourceSets.main.compileClasspath += configurations.optional diff --git a/separate-builds/core/gradle/versions.gradle b/separate-builds/core/gradle/versions.gradle new file mode 100644 index 000000000..4774b4044 --- /dev/null +++ b/separate-builds/core/gradle/versions.gradle @@ -0,0 +1,19 @@ +version = '2.11.0-SNAPSHOT' + +ext.versions = [ + 'xtext': version, + 'lsapi': '0.2.0-SNAPSHOT', + 'log4j': '1.2.16', + 'equinoxCommon' : '3.6.0', + 'equinoxRegistry' : '3.5.0.v20100503', + 'eclipseCore': '3.6.0.v20100505', + 'emfCommon': '[2.10.1,3.0[', + 'emfEcore': '[2.10.2,3.0[', + 'emfMwe': '1.3.20.201605261059', + 'emfMwe2': '[2.8.3,2.9[', + 'xpand': '2.0.0', + 'guice': '3.0', + 'antlr': '3.2', + 'asm': '5.0.1', + 'icu': '52.1' +] diff --git a/separate-builds/core/settings.gradle b/separate-builds/core/settings.gradle new file mode 100644 index 000000000..ddd1a0c31 --- /dev/null +++ b/separate-builds/core/settings.gradle @@ -0,0 +1,13 @@ +rootProject.name = 'xtext-core' + +[ + 'org.eclipse.xtext', + 'org.eclipse.xtext.ide', + 'org.eclipse.xtext.util', + 'org.eclipse.xtext.smap', + 'org.eclipse.xtext.xtext.generator', + 'org.eclipse.xtext.xtext.wizard' +].each { projectName -> + include projectName + project(":$projectName").projectDir = file("../../plugins/$projectName") +} diff --git a/splitting/.classpath b/splitting/.classpath new file mode 100644 index 000000000..fceb4801b --- /dev/null +++ b/splitting/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/splitting/.project b/splitting/.project new file mode 100644 index 000000000..255dd984a --- /dev/null +++ b/splitting/.project @@ -0,0 +1,17 @@ + + + splitting + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/splitting/.settings/org.eclipse.jdt.core.prefs b/splitting/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..3a2153707 --- /dev/null +++ b/splitting/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/splitting/README.md b/splitting/README.md new file mode 100644 index 000000000..a83febc96 --- /dev/null +++ b/splitting/README.md @@ -0,0 +1,15 @@ +# Repository Splitting + +This project provides tools for splitting the Xtext repository as described [in the Wiki](https://github.com/eclipse/xtext/wiki/Restructuring). This is the proposed work flow: + + 1. `../gradlew findProjects` creates `build/splitting/all-projects.txt`, a list of all projects (paths with a `.project` file) that have ever been in the history, and `build/splitting/unmapped-paths.txt`, a list of paths that are not covered by any project. + 2. Create `splitting.txt` based on the results of the previous step. This file must consist of lines of the form `path >> target-repos`, where `path` can be any file or directory in the repository and `target-repos` is either `delete` or a list of repository ids where that path should be included. + 3. `../gradlew clean validateSplitting` checks whether `splitting.txt` covers all files found in the history. + 4. `../gradlew generateRemovals` creates `build/splitting/removals-*.txt` for each target repository. + +Now you have all necessary data to perform the actual splitting. In order to do this: + + 1. Create and checkout a new branch. + 2. Run `../gradlew *FilterBranch`, where `*` is the target repository id. + 3. Find something else to do (on my machine the previous command takes more than one hour). + 4. Push the resulting branch to the corresponding repository. diff --git a/splitting/build.gradle b/splitting/build.gradle new file mode 100644 index 000000000..bf9028d41 --- /dev/null +++ b/splitting/build.gradle @@ -0,0 +1,72 @@ +apply plugin: 'java' + +sourceSets.main.java.srcDirs = ['src'] + +def outputFilesDir = "$buildDir/splitting" +def allHistoryFiles = file(outputFilesDir + "/all-files.txt") +def allProjects = file(outputFilesDir + "/all-projects.txt") +def unmappedPaths = file(outputFilesDir + "/unmapped-paths.txt") +def splittingFile = file("splitting.txt") +def repositories = ["core", "extras", "lib", "xtend", "eclipse", "idea", "web", "maven", "xtext-website", "xtend-website"] + +task listFiles(type: Exec) { + group 'Splitting Helper' + description 'Creates a list of all files that have ever been in the git history.' + outputs.file allHistoryFiles + workingDir '..' + commandLine 'git', 'log', '--pretty=format:', '--name-only', '--diff-filter=A' + doFirst { + new File(allHistoryFiles.parent).mkdirs() + standardOutput = new FileOutputStream(allHistoryFiles) + } +} + +task findProjects(type: JavaExec) { + group 'Splitting Helper' + description 'Creates a list of all projects that have ever been in the git history.' + dependsOn(sourceSets.main.runtimeClasspath, listFiles) + inputs.file allHistoryFiles + outputs.files allProjects, unmappedPaths + classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} + main = "org.eclipse.xtext.splitting.FindProjects" + args outputFilesDir +} + +task validateSplitting(type: JavaExec) { + group 'Splitting Helper' + description 'Checks splitting.txt for validity.' + dependsOn(sourceSets.main.runtimeClasspath, listFiles) + inputs.files splittingFile, allHistoryFiles + classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} + main = "org.eclipse.xtext.splitting.ValidateSplitting" + args splittingFile, outputFilesDir +} + +task generateRemovals(type: JavaExec) { + group 'Splitting Helper' + description 'Generates a list of files to remove for each repository.' + dependsOn(sourceSets.main.runtimeClasspath, validateSplitting) + inputs.files splittingFile + outputs.files repositories.collect{ file("$outputFilesDir/removals-${it}.txt") } + classpath = sourceSets.main.runtimeClasspath.filter{it.exists()} + main = "org.eclipse.xtext.splitting.GenerateRemovals" + args splittingFile, outputFilesDir +} + +repositories.each { targetRepo -> + def removalsFile = file("$outputFilesDir/removals-${targetRepo}.txt") + task "${targetRepo}FilterBranch"(type: Exec) { + group 'Git History Manipulation' + description "Filters the git history for the target repository ${targetRepo}." + dependsOn(generateRemovals) + inputs.file removalsFile + workingDir '..' + commandLine 'splitting/git-filter-branch.sh', removalsFile.path, file('.').canonicalPath, targetRepo + } +} + +task(allFilterBranch) { + group 'Git History Manipulation' + description 'Runs the filter-branch tasks for all target repositories.' + repositories.each { dependsOn("${it}FilterBranch") } +} diff --git a/splitting/git-filter-branch.sh b/splitting/git-filter-branch.sh new file mode 100755 index 000000000..a8ff18c30 --- /dev/null +++ b/splitting/git-filter-branch.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# TODO change source branch to 'master' +git checkout -B split-$3 msp/separateBuilds + +REMOVALS=`cat $1 | tr '\n' ' '` +git filter-branch -f --prune-empty \ + --index-filter "git rm -qrf --cached --ignore-unmatch $REMOVALS" \ + --parent-filter $2/parent-filter.sh \ + HEAD diff --git a/splitting/parent-filter.sh b/splitting/parent-filter.sh new file mode 100755 index 000000000..64f90fa28 --- /dev/null +++ b/splitting/parent-filter.sh @@ -0,0 +1,10 @@ +#!/bin/bash +read INPUT +if [ -n "$INPUT" ] +then + SHOW_BRANCH=`git show-branch --independent ${INPUT//-p/}` + for PARENT in $SHOW_BRANCH + do + echo -n "-p $PARENT " + done +fi diff --git a/splitting/settings.gradle b/splitting/settings.gradle new file mode 100644 index 000000000..e69de29bb diff --git a/splitting/splitting.txt b/splitting/splitting.txt new file mode 100644 index 000000000..da2eb66d3 --- /dev/null +++ b/splitting/splitting.txt @@ -0,0 +1,264 @@ +plugins/org.eclipse.xtext >> core +plugins/org.eclipse.xtext.core >> core +plugins/org.eclipse.xtext.ide >> core +plugins/org.eclipse.xtext.util >> core +plugins/org.eclipse.xtext.xtext.generator >> core +plugins/org.eclipse.xtext.xtext.wizard >> core +tests/org.eclipse.xtext.tests >> core, extras +tests/org.eclipse.xtext.ide.tests >> core +devtools/org.eclipse.xtext.bootstrap >> core +devtools/org.eclipse.xtext.contributor >> core +separate-builds/core >> core + +devtools/org.eclipse.xtext.language-generator >> extras +plugins/org.eclipse.xtext.builder.standalone >> extras +plugins/org.eclipse.xtext.common.types >> extras +plugins/org.eclipse.xtext.ecore >> extras +plugins/org.eclipse.xtext.generator >> extras +plugins/org.eclipse.xtext.generator.parser >> extras +plugins/org.eclipse.xtext.index >> extras +plugins/org.eclipse.xtext.java >> extras +plugins/org.eclipse.xtext.purexbase >> extras +plugins/org.eclipse.xtext.purexbase.test >> extras +plugins/org.eclipse.xtext.smap >> extras +plugins/org.eclipse.xtext.xbase >> extras +plugins/org.eclipse.xtext.xbase.ide >> extras +tests/org.eclipse.xtext.generator.tests >> extras +tests/org.eclipse.xtext.common.types.test >> extras, eclipse +tests/org.eclipse.xtext.common.types.tests >> extras, eclipse +tests/org.eclipse.xtext.java.tests >> extras, eclipse +tests/org.eclipse.xtext.purexbase.tests >> extras, eclipse +tests/org.eclipse.xtext.testlanguages >> extras +tests/org.eclipse.xtext.testlanguages.ide >> extras +tests/org.eclipse.xtext.testlanguages.tests >> extras +tests/org.eclipse.xtext.xbase.tests >> extras +separate-builds/extras >> extras + +maven/org.eclipse.xtend.lib.gwt.test >> lib +maven/org.eclipse.xtext.xbase.lib.slim >> lib +plugins/org.eclipse.xtend.lib >> lib +plugins/org.eclipse.xtend.lib.gwt >> lib +plugins/org.eclipse.xtend.lib.macro >> lib +plugins/org.eclipse.xtend.lib.maven >> lib +plugins/org.eclipse.xtend2.lib >> lib +plugins/org.eclipse.xtext.xbase.lib >> lib +plugins/org.eclipse.xtext.xbase.lib.gwt >> lib +plugins/org.eclipse.xtext.xbase.lib.maven >> lib +plugins/org.eclipse.xtext.xtend2.lib >> lib +separate-builds/lib >> lib + +docs/org.eclipse.xtend.bootstrapdoc >> xtend +docs/org.eclipse.xtend.doc >> xtend +docs/org.eclipse.xtend.doc.xdoc >> xtend +examples/org.eclipse.xtend.examples >> xtend +examples/org.eclipse.xtend.examples-container >> xtend +plugins/org.eclipse.xtend.bootstrapdoc >> xtend +plugins/org.eclipse.xtend.core >> xtend +plugins/org.eclipse.xtend.doc >> xtend +plugins/org.eclipse.xtend.doc.xdoc >> xtend +plugins/org.eclipse.xtend.gradle.plugin >> xtend +plugins/org.eclipse.xtend.ide >> xtend +plugins/org.eclipse.xtend.ide.common >> xtend +plugins/org.eclipse.xtend.m2e >> xtend +plugins/org.eclipse.xtend.macro >> xtend +plugins/org.eclipse.xtend.macro.lang >> xtend +plugins/org.eclipse.xtend.macro.lang.tests >> xtend +plugins/org.eclipse.xtend.macro.lang.ui >> xtend +plugins/org.eclipse.xtend.maven >> xtend +plugins/org.eclipse.xtend.maven.android.archetype >> xtend +plugins/org.eclipse.xtend.maven.archetype >> xtend +plugins/org.eclipse.xtend.standalone >> xtend +plugins/org.eclipse.xtend.xdoc >> xtend +plugins/org.eclipse.xtext.xtend >> xtend +plugins/org.eclipse.xtext.xtend2 >> xtend +plugins/org.eclipse.xtext.xtend2.bootstrapdoc >> xtend +plugins/org.eclipse.xtext.xtend2.doc >> xtend +plugins/org.eclipse.xtext.xtend2.m2e >> xtend +plugins/org.eclipse.xtext.xtend2.ui >> xtend +tests/org.eclipse.xtend.caliper.tests >> xtend +tests/org.eclipse.xtend.core.tests >> xtend +tests/org.eclipse.xtend.core.tests.java8 >> xtend +tests/org.eclipse.xtend.ide.swtbot.tests >> xtend +tests/org.eclipse.xtend.ide.tests >> xtend +tests/org.eclipse.xtend.ide.tests.data >> xtend +tests/org.eclipse.xtend.macro.lang.tests >> xtend +tests/org.eclipse.xtend.performance.tests >> xtend +tests/org.eclipse.xtend.standalone.tests >> xtend +tests/org.eclipse.xtend.swtbot >> xtend +tests/org.eclipse.xtext.xtend.tests >> xtend +tests/org.eclipse.xtext.xtend2.standalone.tests >> xtend +tests/org.eclipse.xtext.xtend2.tests >> xtend +tests/org.eclipse.xtext.xtend2.ui.tests >> xtend +separate-builds/xtend >> xtend + +features >> eclipse +releng >> eclipse +docs/gen_toc.jar >> eclipse +docs/org.eclipse.xtext.doc >> eclipse +docs/org.eclipse.xtext.doc.xdoc >> eclipse +examples/org.eclipse.xtext.example.domainmodel >> eclipse +examples/org.eclipse.xtext.example.domainmodel.ui >> eclipse +examples/org.eclipse.xtext.example.ecoredsl >> eclipse +examples/org.eclipse.xtext.example.ecoredsl.ui >> eclipse +examples/org.eclipse.xtext.example.fowlerdsl >> eclipse +examples/org.eclipse.xtext.example.fowlerdsl.ui >> eclipse +examples/org.eclipse.xtext.xtext.ui.examples >> eclipse +plugins/org.eclipse.xtext.activities >> eclipse +plugins/org.eclipse.xtext.builder >> eclipse +plugins/org.eclipse.xtext.common.types.edit >> eclipse +plugins/org.eclipse.xtext.common.types.shared >> eclipse +plugins/org.eclipse.xtext.common.types.shared.jdt38 >> eclipse +plugins/org.eclipse.xtext.common.types.ui >> eclipse +plugins/org.eclipse.xtext.common.ui >> eclipse +plugins/org.eclipse.xtext.compatibility.galileo >> eclipse +plugins/org.eclipse.xtext.doc >> eclipse +plugins/org.eclipse.xtext.doc.xdoc >> eclipse +plugins/org.eclipse.xtext.gmf.glue >> eclipse +plugins/org.eclipse.xtext.graphviewer.ui >> eclipse +plugins/org.eclipse.xtext.junit >> eclipse +plugins/org.eclipse.xtext.junit4 >> eclipse +plugins/org.eclipse.xtext.log4j >> eclipse +plugins/org.eclipse.xtext.logging >> eclipse +plugins/org.eclipse.xtext.m2e >> eclipse +plugins/org.eclipse.xtext.purexbase.ui >> eclipse +plugins/org.eclipse.xtext.preference >> eclipse +plugins/org.eclipse.xtext.service >> eclipse +plugins/org.eclipse.xtext.service.ui >> eclipse +plugins/org.eclipse.xtext.ui >> eclipse +plugins/org.eclipse.xtext.ui.builtin >> eclipse +plugins/org.eclipse.xtext.ui.codetemplates >> eclipse +plugins/org.eclipse.xtext.ui.codetemplates.ui >> eclipse +plugins/org.eclipse.xtext.ui.common >> eclipse +plugins/org.eclipse.xtext.ui.common.xtend >> eclipse +plugins/org.eclipse.xtext.ui.core >> eclipse +plugins/org.eclipse.xtext.ui.ecore >> eclipse +plugins/org.eclipse.xtext.ui.generator >> eclipse +plugins/org.eclipse.xtext.ui.junit >> eclipse +plugins/org.eclipse.xtext.ui.shared >> eclipse +plugins/org.eclipse.xtext.wikitext.core >> eclipse +plugins/org.eclipse.xtext.wizard >> eclipse +plugins/org.eclipse.xtext.xbase.doc >> eclipse +plugins/org.eclipse.xtext.xbase.junit >> eclipse +plugins/org.eclipse.xtext.xbase.ui >> eclipse +plugins/org.eclipse.xtext.xtext.ui >> eclipse +plugins/org.eclipse.xtext.xtext.ui.graph >> eclipse +tests/org.eclipse.xtext.automated.tests >> eclipse +tests/org.eclipse.xtext.builder.tests >> eclipse +tests/org.eclipse.xtext.example.domainmodel.ui.tests >> eclipse +tests/org.eclipse.xtext.index.tests >> eclipse +tests/org.eclipse.xtext.junit4.tests >> eclipse +tests/org.eclipse.xtext.preference.tests >> eclipse +tests/org.eclipse.xtext.service.tests >> eclipse +tests/org.eclipse.xtext.service.ui.tests >> eclipse +tests/org.eclipse.xtext.testlanguages.ui >> eclipse +tests/org.eclipse.xtext.ui.codetemplates.tests >> eclipse +tests/org.eclipse.xtext.ui.common.tests >> eclipse +tests/org.eclipse.xtext.ui.core.tests >> eclipse +tests/org.eclipse.xtext.ui.integration.tests >> eclipse +tests/org.eclipse.xtext.ui.tests >> eclipse +tests/org.eclipse.xtext.wikitext.tests >> eclipse +tests/org.eclipse.xtext.xbase.testlanguages >> eclipse +tests/org.eclipse.xtext.xbase.testlanguages.ui >> eclipse +tests/org.eclipse.xtext.xbase.ui.tests >> eclipse +tests/org.eclipse.xtext.xtext.ui.graph.tests >> eclipse +tests/org.eclipse.xtext.xtext.ui.tests >> eclipse +separate-builds/eclipse >> eclipse + +intellij >> idea +separate-builds/idea >> idea + +web >> web +separate-builds/web >> web + +maven/org.eclipse.xtend.core >> maven +maven/org.eclipse.xtend.ide.common >> maven +maven/org.eclipse.xtend.maven.android.archetype >> maven +maven/org.eclipse.xtend.maven.archetype >> maven +maven/org.eclipse.xtend.maven.plugin >> maven +maven/org.eclipse.xtext >> maven +maven/org.eclipse.xtext.common.types >> maven +maven/org.eclipse.xtext.dependencies >> maven +maven/org.eclipse.xtext.ide >> maven +maven/org.eclipse.xtext.maven.plugin >> maven +maven/org.eclipse.xtext.parent >> maven +maven/org.eclipse.xtext.standalone.parent >> maven +maven/org.eclipse.xtext.target >> maven +maven/org.eclipse.xtext.tycho.parent >> maven +maven/org.eclipse.xtext.tycho.tests.parent >> maven +maven/org.eclipse.xtext.xbase >> maven +maven/org.eclipse.xtext.xtext >> maven +plugins/org.eclipse.xtend.maven.plugin >> maven +plugins/org.eclipse.xtend.standalone.maven >> maven +plugins/org.eclipse.xtend2.lib.maven >> maven +plugins/org.eclipse.xtend2.maven.plugin >> maven +plugins/org.eclipse.xtend2.standalone.maven >> maven +plugins/org.eclipse.xtext.maven.plugin >> maven +plugins/org.eclipse.xtext.standalone.maven >> maven +plugins/org.eclipse.xtext.xtend2.maven >> maven +plugins/org.eclipse.xtext.xtend2.standalone >> maven +plugins/org.eclipse.xtext.xtend2.standalone.maven >> maven +separate-builds/maven >> maven + +website >> xtext-website +xtext-website >> xtext-website +xtext.website.generator >> xtext-website + +website-xtend >> xtend-website +xtend-website >> xtend-website +xtend.website.generator >> xtend-website + +.DS_Store >> delete +.gitignore >> delete +.project >> delete +.settings >> delete +CONTRIBUTING >> delete +README.md >> delete +build.gradle >> delete +develop >> delete +devtools/com.rcpquickstart.bundletestcollector >> delete +devtools/org.eclipse.xtext.reference >> delete +devtools/org.eclipse.xtext.reference.ui >> delete +devtools/org.eclipse.xtext.testcollector >> delete +docs/images >> delete +docs/org.xtext.sevenlanguages.doc.xdoc >> delete +dummy.txt >> delete +gradle >> delete +gradle-app.setting >> delete +gradle.ant >> delete +gradle.properties >> delete +gradlew >> delete +gradlew.bat >> delete +hover.patch.txt >> delete +jenkins >> delete +maven/.settings >> delete +maven/build.gradle >> delete +maven/mvnw >> delete +maven/mvnw.bat >> delete +maven/wrapper >> delete +org.eclipse.core.resources.prefs >> delete +org.eclipse.core.runtime.prefs >> delete +org.eclipse.jdt.core.prefs >> delete +org.eclipse.jdt.launching.prefs >> delete +org.eclipse.jdt.ui.prefs >> delete +org.eclipse.xtend.core.Xtend.prefs >> delete +plugins/.settings >> delete +plugins/build.gradle >> delete +plugins/com.google.collect >> delete +plugins/com.google.guava >> delete +plugins/com.google.guice >> delete +plugins/com.google.inject >> delete +plugins/images >> delete +plugins/org.antlr.gen >> delete +plugins/org.antlr.runtime >> delete +plugins/org.apache.log4j >> delete +plugins/org.eclipse.emf.index >> delete +plugins/org.eclipse.emf.index.ui >> delete +plugins/org.eclipse.xtext.doc.manual >> delete +settings.gradle >> delete +splitting >> delete +separate-builds/.project >> delete +test.txt >> delete +tests/.settings >> delete +tests/build.gradle >> delete +tests/org.eclipse.emf.index.tests >> delete +tests/org.eclipse.emf.index.ui.tests >> delete diff --git a/splitting/src/org/eclipse/xtext/splitting/FindProjects.java b/splitting/src/org/eclipse/xtext/splitting/FindProjects.java new file mode 100644 index 000000000..e685c5fe7 --- /dev/null +++ b/splitting/src/org/eclipse/xtext/splitting/FindProjects.java @@ -0,0 +1,168 @@ +/******************************************************************************* + * Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.xtext.splitting; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.FileWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class FindProjects { + + public static final String ALL_FILES = "all-files.txt"; + public static final String ALL_PROJECTS = "all-projects.txt"; + public static final String UNMAPPED_PATHS = "unmapped-paths.txt"; + + public static void main(String[] args) { + if (args.length != 1) { + fail("Expected path to output files as argument."); + } + String outputDir = args[0]; + try { + final Directory root = new Directory(".", null); + try (BufferedReader reader = new BufferedReader(new FileReader(outputDir + "/" + ALL_FILES))) { + // Gather all paths in a directory structure + String line; + while ((line = reader.readLine()) != null) { + String[] segments = line.split("/"); + DirectoryEntry current = root; + for (int i = 0; i < segments.length; i++) { + String segment = segments[i].replaceAll("\"|\\\\.", ""); + if (!segment.isEmpty() && current instanceof Directory) { + Directory currentDir = (Directory) current; + if (currentDir.entries.containsKey(segment)) + current = currentDir.entries.get(segment); + else { + DirectoryEntry newEntry; + if (i == segments.length - 1) + newEntry = new DirectoryEntry(segment, currentDir); + else + newEntry = new Directory(segment, currentDir); + currentDir.entries.put(segment, newEntry); + current = newEntry; + } + } + } + } + } + + // Find the projects and unmapped paths that are relevant for the repository history + final List projects = new ArrayList<>(); + final List otherPaths = new ArrayList<>(); + findProjects(root, projects, otherPaths, false); + + // Write the collected projects into a file + Collections.sort(projects); + try (FileWriter writer = new FileWriter(outputDir + "/" + ALL_PROJECTS)) { + for (Directory project : projects) { + writer.write(project.toString()); + writer.write('\n'); + } + } + + // Write the unmapped paths into another file + Collections.sort(otherPaths); + try (FileWriter writer = new FileWriter(outputDir + "/" + UNMAPPED_PATHS)) { + for (DirectoryEntry path : otherPaths) { + writer.write(path.toString()); + writer.write('\n'); + } + } + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } + + private static void fail(String message) { + System.err.print("ERROR: "); + System.err.println(message); + System.exit(1); + } + + private static boolean findProjects(Directory dir, List projects, List otherPaths, boolean skipOtherPaths) { + boolean containsProject = dir.parent != null && dir.entries.values().stream().anyMatch((e) -> e.name.equals(".project")); + if (containsProject) { + projects.add(dir); + skipOtherPaths = true; + } + Set subDirsWithProjects = new HashSet<>(); + for (DirectoryEntry entry : dir.entries.values()) { + if (entry instanceof Directory) { + Directory subDir = (Directory) entry; + if (findProjects(subDir, projects, otherPaths, skipOtherPaths)) + subDirsWithProjects.add(subDir); + } + } + if (!skipOtherPaths && !subDirsWithProjects.isEmpty()) { + for (DirectoryEntry entry : dir.entries.values()) { + if (!subDirsWithProjects.contains(entry)) + otherPaths.add(entry); + } + } + return containsProject || !subDirsWithProjects.isEmpty(); + } + + private static class DirectoryEntry implements Comparable { + final String name; + final Directory parent; + + DirectoryEntry(String name, Directory parent) { + this.name = name; + this.parent = parent; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Directory) { + Directory other = (Directory) obj; + return this.parent == other.parent && this.name.equals(other.name); + } + return false; + } + + @Override + public int hashCode() { + if (parent == null) + return name.hashCode(); + else + return parent.hashCode() * 7 + name.hashCode(); + } + + @Override + public int compareTo(DirectoryEntry other) { + if (this.parent == other.parent) + return this.name.compareTo(other.name); + else + return this.toString().compareTo(other.toString()); + } + + @Override + public String toString() { + if (parent == null || parent.parent == null) + return name; + else + return parent.toString() + "/" + name; + } + } + + private static class Directory extends DirectoryEntry { + final Map entries = new HashMap<>(); + + Directory(String name, Directory parent) { + super(name, parent); + } + } + +} diff --git a/splitting/src/org/eclipse/xtext/splitting/GenerateRemovals.java b/splitting/src/org/eclipse/xtext/splitting/GenerateRemovals.java new file mode 100644 index 000000000..ab4651dfb --- /dev/null +++ b/splitting/src/org/eclipse/xtext/splitting/GenerateRemovals.java @@ -0,0 +1,111 @@ +/******************************************************************************* + * Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.xtext.splitting; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.FileWriter; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class GenerateRemovals { + + public static final Set GEN_DIRS = Collections.unmodifiableSet(new LinkedHashSet<>(Arrays.asList( + "src-gen", "xtend-gen", "xtext-gen", "emf-gen" + ))); + + public static void main(String[] args) { + if (args.length != 2) { + fail("Expected paths to splitting.txt and output files as arguments."); + } + String outputDir = args[1]; + try { + final Map> removalPaths = new HashMap<>(); + for (String targetRepo : ValidateSplitting.REPOSITORIES) { + removalPaths.put(targetRepo, new LinkedHashSet<>()); + } + + // Gather paths to be removed from the history for each target repository + try (BufferedReader reader = new BufferedReader(new FileReader(args[0]))) { + String line; + while ((line = reader.readLine()) != null) { + if (!line.isEmpty()) { + String[] parts = line.split(">>"); + String[] repos = parts[1].split(","); + for (String targetRepo : ValidateSplitting.REPOSITORIES) { + boolean isInTargetRepo = false; + for (String repo : repos) { + if (targetRepo.equals(repo.trim())) { + isInTargetRepo = true; + break; + } + } + if (!isInTargetRepo) { + String path = parts[0].trim(); + removalPaths.get(targetRepo).add(path); + } + } + } + } + } + + // Add directories with generated code to the removal list + final Pattern segmentPattern = Pattern.compile("/"); + try (BufferedReader reader = new BufferedReader(new FileReader(outputDir + "/" + FindProjects.ALL_FILES))) { + String line; + while ((line = reader.readLine()) != null) { + String file = line.replaceAll("\"|\\\\.", ""); + for (String genDir : GEN_DIRS) { + int genDirIndex = file.indexOf(genDir); + if (genDirIndex > 0) { + for (String targetRepo : ValidateSplitting.REPOSITORIES) { + Set repoRemovals = removalPaths.get(targetRepo); + Matcher matcher = segmentPattern.matcher(file); + boolean foundRemoval = false; + int genDirEndIndex = genDirIndex + genDir.length(); + while (!foundRemoval && matcher.find() && matcher.start() <= genDirEndIndex) { + if (repoRemovals.contains(file.substring(0, matcher.start()))) + foundRemoval = true; + } + if (!foundRemoval) + repoRemovals.add(file.substring(0, genDirEndIndex)); + } + } + } + } + } + + // Write a removal list for each target repository + for (String targetRepo : ValidateSplitting.REPOSITORIES) { + try (FileWriter writer = new FileWriter(outputDir + "/removals-" + targetRepo + ".txt")) { + for (String path : removalPaths.get(targetRepo)) { + writer.write(path); + writer.write('\n'); + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } + + private static void fail(String message) { + System.err.print("ERROR: "); + System.err.println(message); + System.exit(1); + } + +} diff --git a/splitting/src/org/eclipse/xtext/splitting/ValidateSplitting.java b/splitting/src/org/eclipse/xtext/splitting/ValidateSplitting.java new file mode 100644 index 000000000..ab6e66c2d --- /dev/null +++ b/splitting/src/org/eclipse/xtext/splitting/ValidateSplitting.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.xtext.splitting; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ValidateSplitting { + + public static final Set REPOSITORIES = Collections.unmodifiableSet(new LinkedHashSet<>(Arrays.asList( + "core", "extras", "lib", "xtend", "eclipse", "idea", "web", "maven", "xtext-website", "xtend-website" + ))); + + public static final String DELETE = "delete"; + + public static void main(String[] args) { + if (args.length != 2) { + fail("Expected paths to splitting.txt and output files as arguments."); + } + String outputDir = args[1]; + try { + + // Validate repositories and gather all paths from the splitting file + final Set specifiedPaths = new HashSet<>(); + try (BufferedReader reader = new BufferedReader(new FileReader(args[0]))) { + String line; + while ((line = reader.readLine()) != null) { + if (!line.isEmpty()) { + String[] parts = line.split(">>"); + if (parts.length != 2) + fail("Invalid line: " + line); + if (!DELETE.equals(parts[1].trim())) { + String[] repos = parts[1].split(","); + if (repos.length == 0) + fail("Invalid line: " + line); + for (String repo : repos) { + String trimmed = repo.trim(); + if (!REPOSITORIES.contains(trimmed)) + fail("Invalid repository: " + trimmed); + } + } + String path = parts[0].trim(); + specifiedPaths.add(path); + } + } + } + + // Check whether each file has a specified path as prefix + final Pattern segmentPattern = Pattern.compile("/"); + try (BufferedReader reader = new BufferedReader(new FileReader(outputDir + "/" + FindProjects.ALL_FILES))) { + String line; + while ((line = reader.readLine()) != null) { + if (!line.isEmpty()) { + String file = line.replaceAll("\"|\\\\.", ""); + if (!specifiedPaths.contains(file)) { + Matcher matcher = segmentPattern.matcher(file); + boolean foundSplitting = false; + while (!foundSplitting && matcher.find()) { + if (specifiedPaths.contains(file.substring(0, matcher.start()))) + foundSplitting = true; + } + if (!foundSplitting) + fail("File not covered by splitting: " + file); + } + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } + + private static void fail(String message) { + System.err.print("ERROR: "); + System.err.println(message); + System.exit(1); + } + +} diff --git a/tests/org.eclipse.xtext.testlanguages.ide/build.gradle b/tests/org.eclipse.xtext.testlanguages.ide/build.gradle new file mode 100644 index 000000000..0f120168b --- /dev/null +++ b/tests/org.eclipse.xtext.testlanguages.ide/build.gradle @@ -0,0 +1,4 @@ +dependencies { + compile project(':org.eclipse.xtext.testlanguages') + compile "org.eclipse.xtext:org.eclipse.xtext.ide:$versions.xtext" +} diff --git a/tests/org.eclipse.xtext.testlanguages/build.gradle b/tests/org.eclipse.xtext.testlanguages/build.gradle new file mode 100644 index 000000000..11d02a497 --- /dev/null +++ b/tests/org.eclipse.xtext.testlanguages/build.gradle @@ -0,0 +1,3 @@ +dependencies { + compile project(':org.eclipse.xtext.common.types') +}