Mail Archive Home | fractal-commits List | August 2008 Index
| <-- Date Index | <-- Thread Index |
Adding an exception to report errors while compiling code.
--- trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CompilationRound.java 2008-08-31 18:05:06 UTC (rev 8427)
+++ trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CompilationRound.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -61,7 +61,8 @@
/**
* Compile the input files (source and generated).
*/
- public void compile( CompileSupportItf compiler ) throws IOException {
+ public void compile( CompileSupportItf compiler )
+ throws IOException, CompileSupportException {
/*
* Compile and move to the next compilation round.
--- trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CompileSupportException.java (rev 0)
+++ trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CompileSupportException.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -0,0 +1,47 @@
+/***
+ * Juliac
+ * Copyright (C) 2008 INRIA, USTL
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Contact: Lionel.Seinturier@xxxxxxxxxxxxxx
+ *
+ * Author: Lionel Seinturier
+ */
+
+package org.objectweb.fractal.juliac;
+
+/**
+ * Exception thrown to report an error while compiling code.
+ *
+ * @author Lionel Seinturier <Lionel.Seinturier@xxxxxxxxxxxxxx>
+ * @since 2.1
+ */
+public class CompileSupportException extends Exception {
+
+ private static final long serialVersionUID = -6094574972861358024L;
+
+ public CompileSupportException( String msg ) {
+ super(msg);
+ }
+
+ public CompileSupportException( Throwable t ) {
+ super(t);
+ }
+
+ public CompileSupportException( String msg, Throwable t ) {
+ super(msg,t);
+ }
+}
--- trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CompileSupportItf.java 2008-08-31 18:05:06 UTC (rev 8427)
+++ trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/CompileSupportItf.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -40,8 +40,8 @@
* @param sfs the source files to compile
* @param classDir the directory where .class files must be stored
* @return the list of compiled type names
- * @throws IOException if a compilation error occurs
+ * @throws CompileSupportException if a compilation error occurs
*/
public List<String> compile( List<SourceFile> sfs, File classDir )
- throws IOException;
+ throws IOException, CompileSupportException;
}
--- trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/Juliac.java 2008-08-31 18:05:06 UTC (rev 8427)
+++ trunk/juliac/compiler/src/main/java/org/objectweb/fractal/juliac/Juliac.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -64,7 +64,7 @@
throws
IllegalArgumentException, IOException, InstantiationException,
java.lang.InstantiationException, IllegalAccessException,
- ClassNotFoundException {
+ ClassNotFoundException, CompileSupportException {
if( args.length == 0 ) {
usage();
@@ -547,7 +547,9 @@
* @param debug if true, report some debug information
* @since 2.0
*/
- public void compileAndReport( boolean debug ) throws IOException {
+ public void compileAndReport( boolean debug )
+ throws IOException, CompileSupportException {
+
reportInfo("Compiling...");
CompilationRound round = compile();
List<SourceFile> inputFiles = round.getInputFiles();
@@ -571,7 +573,7 @@
* may be either input source code or generated source code.
*/
public CompilationRound compile()
- throws IOException, IllegalArgumentException {
+ throws IOException, CompileSupportException, IllegalArgumentException {
/*
* First check if there is some files to compile.
--- trunk/juliac/examples/advanced/foobar-cases/absolutepath/src/test/java/example/absolutepath/AbsolutePathTestCase.java 2008-08-31 18:05:06 UTC (rev 8427)
+++ trunk/juliac/examples/advanced/foobar-cases/absolutepath/src/test/java/example/absolutepath/AbsolutePathTestCase.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -32,6 +32,7 @@
import java.util.HashMap;
import org.junit.Test;
+import org.objectweb.fractal.juliac.CompileSupportException;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.JuliacParams;
import org.objectweb.fractal.juliac.Utils;
@@ -48,7 +49,8 @@
public void test()
throws
IllegalArgumentException, IOException, InstantiationException,
- IllegalAccessException, ClassNotFoundException {
+ IllegalAccessException, ClassNotFoundException,
+ CompileSupportException {
/*
* Create a temporary directory.
--- trunk/juliac/mojo/src/main/java/org/objectweb/fractal/juliac/JuliacMojo.java 2008-08-31 18:05:06 UTC (rev 8427)
+++ trunk/juliac/mojo/src/main/java/org/objectweb/fractal/juliac/JuliacMojo.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -233,7 +233,7 @@
MalformedURLException, DependencyResolutionRequiredException,
ArtifactResolutionException, ArtifactNotFoundException,
java.lang.InstantiationException, IllegalAccessException,
- ClassNotFoundException {
+ ClassNotFoundException, CompileSupportException {
Juliac jc = new Juliac();
File baseDir = project.getBasedir();
--- trunk/juliac/plugin/jdt/src/main/java/org/objectweb/fractal/juliac/compile/jdt/CompileSupportImpl.java 2008-08-31 18:05:06 UTC (rev 8427)
+++ trunk/juliac/plugin/jdt/src/main/java/org/objectweb/fractal/juliac/compile/jdt/CompileSupportImpl.java 2008-08-31 18:34:00 UTC (rev 8428)
@@ -33,6 +33,7 @@
import org.eclipse.jdt.internal.compiler.ClassFile;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
+import org.objectweb.fractal.juliac.CompileSupportException;
import org.objectweb.fractal.juliac.CompileSupportItf;
import org.objectweb.fractal.juliac.SourceFile;
@@ -55,10 +56,10 @@
* @param sfs the source files to compile
* @param classDir the directory where .class files must be stored
* @return the list of compiled type names
- * @throws IOException if a compilation error occurs
+ * @throws CompileSupportException if a compilation error occurs
*/
public List<String> compile( List<SourceFile> sfs, File classDir )
- throws IOException {
+ throws IOException, CompileSupportException {
/*
* Construct a list of {@link ICompilationUnit}s from the {@link
| <-- Date Index | <-- Thread Index |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.