From ded399dd7b7afa6a92aa257be4dc89d3ae9d9009 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 30 Jan 2004 14:44:38 +0000 Subject: [PATCH] The gcj compiler adapter failed if the destdir didn't exist. PR: 25856 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275986 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 79d86514d..95bb5f597 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -28,6 +28,9 @@ Fixed bugs: * ignored the append attribute, Bugzilla Report 26137. +* The gcj compiler adapter for failed if the destination + directory didn't exist. Bugzilla Report 25856. + Other changes: -------------- * Translate task logs a debug message specifying the number of files diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java index da440566a..ac98f174a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java +++ b/src/main/org/apache/tools/ant/taskdefs/compilers/Gcj.java @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2003 The Apache Software Foundation. All rights + * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,10 +119,10 @@ public class Gcj extends DefaultCompilerAdapter { cmd.createArgument().setValue("-d"); cmd.createArgument().setFile(destDir); - if (destDir.mkdirs()) { + if (!destDir.exists() && !destDir.mkdirs()) { throw new BuildException("Can't make output directories. " + "Maybe permission is wrong. "); - }; + } } cmd.createArgument().setValue("-classpath");