Commit be0b6f5c authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* made spacing and logging more consistent

* made batch resolve optional with CLI parameter (off by default)
* added skipXtexGeneration property to POM when no grammar changes are performed
parent 40f9ee62
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ public class Resolver implements Callable<String> {
		Stopwatch stopwatch = Stopwatch.createStarted();
		EcoreUtil2.resolveAll(resource);
		if (T3Q.getLogLevel().equals(LogLevel.DEBUG)) {
			System.out.print("Resolving "+resource.getURI().path().substring(1)+"...");
			System.out.println("\tdone in " + stopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms ("
			System.out.print("Resolving file: "+resource.getURI().path().substring(1));
			System.out.println("\t...done in " + stopwatch.elapsed(TimeUnit.MILLISECONDS) + "ms ("
					+ MiscTools.secondsToString(stopwatch.elapsed(TimeUnit.SECONDS)) + " minutes).");
		}
		stopwatch.stop();
+15 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class T3Q {
	private final Stopwatch stopwatch = Stopwatch.createUnstarted();
	private boolean singleCore = false;
	private boolean analyzeUsage = false;
	private boolean batchResolve = false;
	
	// private boolean formattingEnabled = false;

@@ -114,6 +115,9 @@ public class T3Q {
		if (isSingleCore()) {
			resourceProvider.setCores(1);
		}
		if (isBatchResolve()) {
			resourceProvider.setBatchResolve(true);
		}
		resourceProvider.loadResources();
		//TODO: check if it has to be exclusive
		if (!this.isGenerateLocalDependencies() && !this.isAnalyzeUsage() ) {
@@ -209,6 +213,9 @@ public class T3Q {
		if (commandLine.hasOption("single-core")) {
			this.setSingleCore(true);
		}
		if (commandLine.hasOption("batch-resolve")) {
			this.setBatchResolve(true);
		}
		if (commandLine.hasOption("analyze-usage")) {
			this.setAnalyzeUsage(true);
		}
@@ -454,4 +461,12 @@ public class T3Q {
	public void setAnalyzeUsage(boolean analyzeUsage) {
		this.analyzeUsage = analyzeUsage;
	}

	public boolean isBatchResolve() {
		return batchResolve;
	}

	public void setBatchResolve(boolean batchResolve) {
		this.batchResolve = batchResolve;
	}
}
+10 −3
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public class TTCN3ResourceProvider {
	private LoggingInterface logger;
	private QualityCheckProfile activeProfile;
	private int cores = Runtime.getRuntime().availableProcessors();
	private boolean batchResolve = false;
	
	@Inject
	private IQualifiedNameProvider qualifiedNameProvider;
@@ -129,9 +130,7 @@ public class TTCN3ResourceProvider {
		
		stopwatch.reset();
		
		//TODO: export as parameter, for now deactivated
		boolean batchResolver = false;
		if (batchResolver) {
		if (isBatchResolve()) {
	
			stopwatch.start();
			
@@ -483,4 +482,12 @@ public class TTCN3ResourceProvider {
	public void setCores(int cores) {
		this.cores = cores;
	}

	public boolean isBatchResolve() {
		return batchResolve;
	}

	public void setBatchResolve(boolean batchResolve) {
		this.batchResolve = batchResolve;
	}
}
+5 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@
	</parent>
	<artifactId>de.ugoe.cs.swe.TTCN3</artifactId>
	<packaging>eclipse-plugin</packaging>
	<properties>
		<skipXtextGeneration>false</skipXtextGeneration>
	</properties>

	<build>
		<plugins>
@@ -25,6 +28,7 @@
					</execution>
				</executions>
				<configuration>
					<skip>${skipXtextGeneration}</skip>
					<mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
					<arguments>
						<argument>/${project.basedir}/src/de/ugoe/cs/swe/GenerateTTCN3.mwe2</argument>
@@ -52,6 +56,7 @@
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
					<skip>${skipXtextGeneration}</skip>
					<filesets combine.children="append">
						<fileset>
							<directory>${basedir}/../de.ugoe.cs.swe.TTCN3/src-gen/</directory>
+2 −2

File changed.

Contains only whitespace changes.