[hg] main-silver: #229353, #231276 use relative path to output d...

  • From: Milos Kleint < >
  • To: ,
  • Subject: [hg] main-silver: #229353, #231276 use relative path to output d...
  • Date: Wed, 10 Jul 2013 07:41:34 -0700

changeset 2a8ea251269d in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/2a8ea251269d
description:
        #229353, #231276 use relative path to output dir on windows only, 
different OS have different current directory when running

diffstat:

 
maven.apisupport/src/org/netbeans/modules/maven/apisupport/CoSApplicationLateBoundChecker.java
 |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (40 lines):

diff --git 
a/maven.apisupport/src/org/netbeans/modules/maven/apisupport/CoSApplicationLateBoundChecker.java
 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/CoSApplicationLateBoundChecker.java
--- 
a/maven.apisupport/src/org/netbeans/modules/maven/apisupport/CoSApplicationLateBoundChecker.java
+++ 
b/maven.apisupport/src/org/netbeans/modules/maven/apisupport/CoSApplicationLateBoundChecker.java
@@ -117,7 +117,8 @@
         }
         String branding = 
PluginPropertyUtils.getPluginProperty(config.getProject(), 
MavenNbModuleImpl.GROUPID_MOJO, MavenNbModuleImpl.NBM_PLUGIN, 
"brandingToken", "cluster-app", "netbeans.branding.token");
         //TODO care about figuring out build.outputdir?
-        File f = new File(new File(config.getExecutionDirectory(), 
"target"), branding); 
+        //only relativize path on windows
+        File currentDir = Utilities.isWindows() ? new File(new 
File(config.getExecutionDirectory(), "target"), branding) : null; 
         
         for (Map.Entry<String, DependencyProjectsProvider.Pair> pairEnt : 
modules.entrySet()) {
                 NbModuleProvider nbm = 
pairEnt.getValue().getProject().getLookup().lookup(NbModuleProvider.class);
@@ -127,7 +128,7 @@
                         sb.append(" ");
                     }
                     
-                    String v = 
projectToOutputDir(pairEnt.getValue().getProject(), f);
+                    String v = 
projectToOutputDir(pairEnt.getValue().getProject(), currentDir);
                     boolean space = v.contains(" ");
                     
sb.append("-J-Dnetbeans.patches.").append(cnb).append("=");
                     if (space) sb.append("\"");
@@ -142,7 +143,7 @@
                                 continue; //skip osgi if used as dependency, 
not classpath
                             }
                             //: or ; is there a constant for it?
-                            sb.append(Utilities.isWindows() ? ";" : 
":").append(projectToOutputDir(exPair.getProject(), f));
+                            sb.append(Utilities.isWindows() ? ";" : 
":").append(projectToOutputDir(exPair.getProject(), currentDir));
                             
                         }
                     }
@@ -158,7 +159,7 @@
     private String projectToOutputDir(Project p, File basedir) {
         //attempt to resolve a relative path to save space on the cmd line..
         File f = new File(new File(FileUtil.toFile(p.getProjectDirectory()), 
"target"), "classes");
-        String toRet = FileUtilities.relativizeFile(basedir, f);
+        String toRet = basedir != null ? 
FileUtilities.relativizeFile(basedir, f) : null;
         if (toRet == null) {
             toRet = f.getAbsolutePath();
         }

[hg] main-silver: #229353, #231276 use relative path to output d...

Milos Kleint 07/10/2013

Project Features

About this Project

APIsupport was started in November 2009, is owned by Antonin Nebuzelsky, and has 54 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150226.965aeb8). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close