Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use proper source path

  • Loading branch information...
commit 3efb90800c074c7115e4c50d37e52d9077561e4c 1 parent 6ec8e63
@JPMoresmau authored
View
15 ....haskell.core/src/net/sf/eclipsefp/haskell/core/internal/project/ProjectModelFilesOp.java
@@ -51,9 +51,10 @@ public void run( final IProject project,
createFile( project, new Path( SETUP_HS ), getSetupFileContent(), mo );
}
+ String src=HaskellProjectCreationOperation.getSourceDir();
if (isExecutable()){
String mainPath="Main";//$NON-NLS-1$
- String src=HaskellProjectCreationOperation.getSourceDir();
+
if (src!=null){
mainPath=src+"/"+mainPath;//$NON-NLS-1$
}
@@ -64,7 +65,7 @@ public void run( final IProject project,
IPath cabalFile = new Path( name ).addFileExtension( FileUtil.EXTENSION_CABAL );
- createFile( project, cabalFile, getCabalFileContent( name ), mo );
+ createFile( project, cabalFile, getCabalFileContent( name,src ), mo );
}
}
@@ -78,11 +79,11 @@ protected String getMainFileContent() {
- private String getCabalFileContent( final String name ) {
- return getCabalFile( name ).dump();
+ private String getCabalFileContent( final String name,final String src ) {
+ return getCabalFile( name ,src).dump();
}
- protected PackageDescription getCabalFile(final String name){
+ protected PackageDescription getCabalFile(final String name,final String src){
/*String s=CabalSyntax.FIELD_NAME.getCabalName()+": " + name + NL //$NON-NLS-1$
+ CabalSyntax.FIELD_VERSION.getCabalName()+": 0.1 "+ NL + NL //$NON-NLS-1$
@@ -112,14 +113,14 @@ protected PackageDescription getCabalFile(final String name){
if (isLibrary()){
PackageDescriptionStanza pds=pd.addStanza( CabalSyntax.SECTION_LIBRARY, null );
- pds.update( CabalSyntax.FIELD_HS_SOURCE_DIRS, FileUtil.DEFAULT_FOLDER_SRC );
+ pds.update( CabalSyntax.FIELD_HS_SOURCE_DIRS, src );
pds.update( CabalSyntax.FIELD_BUILD_DEPENDS, "base >= 4" ); //$NON-NLS-1$
pds.update( CabalSyntax.FIELD_GHC_OPTIONS, "-Wall" ); //$NON-NLS-1$
}
if (isExecutable()){
PackageDescriptionStanza pds=pd.addStanza( CabalSyntax.SECTION_EXECUTABLE, name );
- pds.update( CabalSyntax.FIELD_HS_SOURCE_DIRS, FileUtil.DEFAULT_FOLDER_SRC );
+ pds.update( CabalSyntax.FIELD_HS_SOURCE_DIRS, src );
pds.update( CabalSyntax.FIELD_MAIN_IS, "Main.hs" ); //$NON-NLS-1$
pds.update( CabalSyntax.FIELD_BUILD_DEPENDS, "base >= 4" ); //$NON-NLS-1$
pds.update( CabalSyntax.FIELD_GHC_OPTIONS, "-Wall" ); //$NON-NLS-1$
Please sign in to comment.
Something went wrong with that request. Please try again.