Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature parafile #15

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9f01315
change repository to clone
Sep 19, 2012
bde51e4
Debug message added
Sep 19, 2012
7f9dc28
refactoring while / for loops
Sep 19, 2012
e4dd5e3
refactoring while / for loops
Sep 19, 2012
71487d0
Merge branch 'master' of
Sep 19, 2012
10db251
Debug info added
Sep 19, 2012
c74ea32
correct Logger added
Sep 20, 2012
fa958e0
Only correct locations to check will by logged
Sep 20, 2012
7f22602
fork get a update from upstream/master via fetch and merge
Oct 20, 2012
a2fe7e8
Conflicts:
Oct 20, 2012
4f50620
url changed to local buildboostrepo
Oct 21, 2012
07db285
buildboost repo url fixed to local correct form file:///
Oct 21, 2012
4a993ff
original master merged into forked master
Nov 25, 2012
762d10f
repository url changed to local folder
Nov 25, 2012
7bfa56f
url changed
Nov 25, 2012
ede483e
url changed to equal command line url
Nov 25, 2012
6e6ce1d
URL changed to my github home
Dec 19, 2012
1a00553
extension pattern changed
Dec 19, 2012
bb0c6e9
Merge remote-tracking branch 'upstream/master'
Dec 19, 2012
1430ca7
Parameterübergabe per File vorbereitet
Dec 20, 2012
13c7b31
read the para file
Dec 20, 2012
cb7a6d8
Encoding of file and folder names extracted to a separate method
Dec 20, 2012
6f89d0d
mem heap to large -> set from 2048 -> 1024
Dec 20, 2012
ade88f5
JVMARGs extracted as constants
Dec 20, 2012
370cb4a
emftext extension changed to
Dec 20, 2012
fe180fd
testonly logging added
Dec 20, 2012
a797c6b
os specific file.separator removed
Dec 20, 2012
e63afdf
debug option added by generating sub tasks emf and emftext
Dec 21, 2012
307b2de
sub task become port 8001
Dec 21, 2012
e042325
manually reset changes for file.separator to commit 71487d0
Dec 21, 2012
e74ec62
first attempt to support a global config file
Dec 22, 2012
73709b2
global config file must be have a length >0 to read
Dec 22, 2012
3da1576
changes inputStream to filereader
Dec 22, 2012
2b91487
change GlobalBuildConfiguration to a singleton with holder
Dec 22, 2012
21f9ed3
move read config file to outer constructor
Dec 22, 2012
f91bd13
global config test
Dec 22, 2012
af46860
obsolete holder constructor removed
Dec 22, 2012
f33d832
debug option computed depend of global configuration
Dec 22, 2012
f88b86e
Default initialization fixed
Dec 22, 2012
4ea72cf
logic for debugging fixed
Dec 22, 2012
4f5df2c
JVMARGs changeable via global config
Dec 22, 2012
87af795
obsolete duplicate call of goblal config reading removed
Dec 22, 2012
6749906
revert specific changes of forked version
Dec 23, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Core/de.devboost.buildboost/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
24 changes: 12 additions & 12 deletions Core/de.devboost.buildboost/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#Thu Nov 10 23:39:13 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
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.6
#Thu Nov 10 23:39:13 CET 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
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.6
6 changes: 3 additions & 3 deletions Core/de.devboost.buildboost/build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source.. = src/
bin.includes = META-INF/,\
.
source.. = src/
bin.includes = META-INF/,\
.
78 changes: 39 additions & 39 deletions Core/de.devboost.buildboost/buildboost_bootstrap.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="buildboost-bootstrap" name="Bootstrap buildboost">
<!-- This script must be called at the beginning of any buildboost process.
It compiles all available buildboost plug-ins. -->
<property name="buildboost_core_src" value="${basedir}"/>
<property name="buildboost_core_plugin_id" value="de.devboost.buildboost"/>
<property name="buildboost_core_bin" value="${build_dir}/artifacts/projects/${buildboost_core_plugin_id}"/>
<target name="buildboost-bootstrap">
<mkdir dir="${build_dir}"/>
<mkdir dir="${buildboost_core_bin}"/>
<echo message="Compile buildboost core plug-in to bootstrap build process" />
<javac srcdir="${buildboost_core_src}/src" destdir="${buildboost_core_bin}" includeantruntime="false" debug="true" />
<echo message="Compile buildboost generator extensions" />
<copy file="${buildboost_core_src}/buildboost_compile_extensions.xml" tofile="${buildboost_core_bin}/buildboost_compile_extensions.xml" />
<ant antfile="buildboost_compile_extensions.xml" dir="${buildboost_core_bin}">
<property name="build_plugin_id" value="${buildboost_core_plugin_id}" />
<property name="workspace" value="${workspace}"/>
<property name="build_dir" value="${build_dir}"/>
</ant>
<copy file="${buildboost_core_src}/buildboost_generate.xml" tofile="${buildboost_core_bin}/buildboost_generate.xml" />
<ant antfile="buildboost_generate.xml" dir="${buildboost_core_bin}">
<property name="buildboost_core_plugin_id" value="${buildboost_core_plugin_id}" />
<property name="workspace" value="${workspace}"/>
<property name="build_dir" value="${build_dir}"/>
</ant>
<echo message="Call master script" />
<ant antfile="${build_dir}/buildboost_master.xml" dir="${build_dir}">
<property name="build_plugin_id" value="${build_plugin_id}" />
<property name="workspace" value="${workspace}"/>
</ant>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="buildboost-bootstrap" name="Bootstrap buildboost">
<!-- This script must be called at the beginning of any buildboost process.
It compiles all available buildboost plug-ins. -->

<property name="buildboost_core_src" value="${basedir}"/>

<property name="buildboost_core_plugin_id" value="de.devboost.buildboost"/>
<property name="buildboost_core_bin" value="${build_dir}/artifacts/projects/${buildboost_core_plugin_id}"/>

<target name="buildboost-bootstrap">
<mkdir dir="${build_dir}"/>
<mkdir dir="${buildboost_core_bin}"/>

<echo message="Compile buildboost core plug-in to bootstrap build process" />
<javac srcdir="${buildboost_core_src}/src" destdir="${buildboost_core_bin}" includeantruntime="false" debug="true" />

<echo message="Compile buildboost generator extensions" />
<copy file="${buildboost_core_src}/buildboost_compile_extensions.xml" tofile="${buildboost_core_bin}/buildboost_compile_extensions.xml" />
<ant antfile="buildboost_compile_extensions.xml" dir="${buildboost_core_bin}">
<property name="build_plugin_id" value="${buildboost_core_plugin_id}" />
<property name="workspace" value="${workspace}"/>
<property name="build_dir" value="${build_dir}"/>
</ant>

<copy file="${buildboost_core_src}/buildboost_generate.xml" tofile="${buildboost_core_bin}/buildboost_generate.xml" />
<ant antfile="buildboost_generate.xml" dir="${buildboost_core_bin}">
<property name="buildboost_core_plugin_id" value="${buildboost_core_plugin_id}" />
<property name="workspace" value="${workspace}"/>
<property name="build_dir" value="${build_dir}"/>
</ant>

<echo message="Call master script" />
<ant antfile="${build_dir}/buildboost_master.xml" dir="${build_dir}">
<property name="build_plugin_id" value="${build_plugin_id}" />
<property name="workspace" value="${workspace}"/>
</ant>
</target>
</project>
40 changes: 20 additions & 20 deletions Core/de.devboost.buildboost/buildboost_compile_extensions.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="buildboost-bootstrap-generate" name="Generate Bootstrap Scripts for buildboost">
<target name="buildboost-bootstrap-generate">
<echo message="Run buildboost bootstrap generator to obtain script that compiles all additional buildboost plug-ins (including the custom build script generator)" />
<java classname="de.devboost.buildboost.BuildScriptGeneratorRunner" failonerror="true">
<arg value="${workspace}" />
<arg value="de.devboost.buildboost.BuildScriptGenerator" />
<classpath>
<pathelement path="${buildboost_core_bin}"/>
</classpath>
</java>
<!-- Call generated script -->
<ant antfile="${build_dir}/buildboost_master.xml" dir="${build_dir}">
<property name="build_plugin_id" value="${buildboost_core_plugin_id}" />
<property name="workspace" value="${workspace}"/>
</ant>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="buildboost-bootstrap-generate" name="Generate Bootstrap Scripts for buildboost">
<target name="buildboost-bootstrap-generate">
<echo message="Run buildboost bootstrap generator to obtain script that compiles all additional buildboost plug-ins (including the custom build script generator)" />
<java classname="de.devboost.buildboost.BuildScriptGeneratorRunner" failonerror="true">
<arg value="${workspace}" />
<arg value="de.devboost.buildboost.BuildScriptGenerator" />

<classpath>
<pathelement path="${buildboost_core_bin}"/>
</classpath>
</java>

<!-- Call generated script -->
<ant antfile="${build_dir}/buildboost_master.xml" dir="${build_dir}">
<property name="build_plugin_id" value="${buildboost_core_plugin_id}" />
<property name="workspace" value="${workspace}"/>
</ant>
</target>
</project>
30 changes: 15 additions & 15 deletions Core/de.devboost.buildboost/buildboost_generate.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="buildboost-generate" name="Generate Scripts using buildboost">
<target name="buildboost-generate">
<echo message="Run custom script generator via delegate" />
<java classname="de.devboost.buildboost.BuildScriptGeneratorRunner" failonerror="true">
<arg value="${workspace}" />
<arg value="${build_plugin_id}.BuildScriptGenerator" />
<classpath>
<pathelement path="${build_dir}/build-boost-bin"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="buildboost-generate" name="Generate Scripts using buildboost">
<target name="buildboost-generate">
<echo message="Run custom script generator via delegate" />
<java classname="de.devboost.buildboost.BuildScriptGeneratorRunner" failonerror="true">
<arg value="${workspace}" />
<arg value="${build_plugin_id}.BuildScriptGenerator" />

<classpath>
<pathelement path="${build_dir}/build-boost-bin"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
</target>
</project>
Original file line number Diff line number Diff line change
@@ -1,80 +1,80 @@
/*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* 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
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
package de.devboost.buildboost;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import de.devboost.buildboost.model.AbstractBuildParticipant;
import de.devboost.buildboost.model.BuildEventType;
import de.devboost.buildboost.model.IArtifact;
import de.devboost.buildboost.model.IArtifactDiscoverer;
import de.devboost.buildboost.model.IArtifactFilter;
import de.devboost.buildboost.model.IBuildContext;
import de.devboost.buildboost.model.IBuildListener;
import de.devboost.buildboost.model.IBuildParticipant;
import de.devboost.buildboost.model.IDependable;
import de.devboost.buildboost.util.ArtifactUtil;
import de.devboost.buildboost.util.Sorter;
public class ArtifactSorter extends AbstractBuildParticipant {
@Override
public boolean dependsOn(IBuildParticipant otherParticipant) {
if (otherParticipant instanceof DependencyResolver) {
return true;
}
if (otherParticipant instanceof UnresolvedDependencyChecker) {
return true;
}
if (otherParticipant instanceof IArtifactDiscoverer) {
return true;
}
if (otherParticipant instanceof IArtifactFilter) {
return true;
}
return false;
}
@Override
public void execute(IBuildContext context) throws BuildException {
Collection<IArtifact> discoveredArtifacts = context.getDiscoveredArtifacts();
IBuildListener buildListener = context.getBuildListener();
Sorter pluginSorter = new Sorter();
// exclude dependencies that cannot be included while sorting
Set<IDependable> discoveredDependables = new ArtifactUtil().getSetOfDependables(discoveredArtifacts);
Set<IDependable> transientHull = pluginSorter.getTransientHull(discoveredDependables);
transientHull.removeAll(discoveredArtifacts);
for (IDependable artifact : transientHull) {
buildListener.handleBuildEvent(
BuildEventType.INFO,
"Artifact " + artifact + " is excluded from topological sorting (artifact is a transitive dependency, but was not selected for build)."
);
}
// sort artifacts topologically
List<IDependable> sortedArtifacts = pluginSorter.topologicalSort(
new ArrayList<IDependable>(discoveredArtifacts),
transientHull);
// replace artifacts
context.removeDiscoveredArtifacts(discoveredArtifacts);
context.addDiscoveredArtifacts(new ArtifactUtil().getConcreteList(sortedArtifacts, IArtifact.class));
}
}
/*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* 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
*
* Contributors:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
package de.devboost.buildboost;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

import de.devboost.buildboost.model.AbstractBuildParticipant;
import de.devboost.buildboost.model.BuildEventType;
import de.devboost.buildboost.model.IArtifact;
import de.devboost.buildboost.model.IArtifactDiscoverer;
import de.devboost.buildboost.model.IArtifactFilter;
import de.devboost.buildboost.model.IBuildContext;
import de.devboost.buildboost.model.IBuildListener;
import de.devboost.buildboost.model.IBuildParticipant;
import de.devboost.buildboost.model.IDependable;
import de.devboost.buildboost.util.ArtifactUtil;
import de.devboost.buildboost.util.Sorter;

public class ArtifactSorter extends AbstractBuildParticipant {

@Override
public boolean dependsOn(IBuildParticipant otherParticipant) {
if (otherParticipant instanceof DependencyResolver) {
return true;
}
if (otherParticipant instanceof UnresolvedDependencyChecker) {
return true;
}
if (otherParticipant instanceof IArtifactDiscoverer) {
return true;
}
if (otherParticipant instanceof IArtifactFilter) {
return true;
}
return false;
}

@Override
public void execute(IBuildContext context) throws BuildException {
Collection<IArtifact> discoveredArtifacts = context.getDiscoveredArtifacts();
IBuildListener buildListener = context.getBuildListener();
Sorter pluginSorter = new Sorter();

// exclude dependencies that cannot be included while sorting
Set<IDependable> discoveredDependables = new ArtifactUtil().getSetOfDependables(discoveredArtifacts);
Set<IDependable> transientHull = pluginSorter.getTransientHull(discoveredDependables);
transientHull.removeAll(discoveredArtifacts);
for (IDependable artifact : transientHull) {
buildListener.handleBuildEvent(
BuildEventType.INFO,
"Artifact " + artifact + " is excluded from topological sorting (artifact is a transitive dependency, but was not selected for build)."
);
}

// sort artifacts topologically
List<IDependable> sortedArtifacts = pluginSorter.topologicalSort(
new ArrayList<IDependable>(discoveredArtifacts),
transientHull);

// replace artifacts
context.removeDiscoveredArtifacts(discoveredArtifacts);
context.addDiscoveredArtifacts(new ArtifactUtil().getConcreteList(sortedArtifacts, IArtifact.class));
}
}
Loading