Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341788

Summary: ajc.bat can only take 9 parameters
Product: [Tools] AspectJ Reporter: Iain McGinniss <iainmcgin>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: aclement
Version: unspecified   
Target Milestone: 1.6.12   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Iain McGinniss CLA 2011-04-04 10:31:52 EDT
Build Identifier: AspectJ Compiler 1.6.11 (1.6.11 - Built: Tuesday Mar 15, 2011 at 15:31:04 GMT) - Eclipse Compiler 0.785_R33x, 3.3

I have been using ajc from the command line while prototyping an aspect code generator. The ajc.bat file only allows 9 command line arguments, when it is easy to have the cmd shell pass through all arguments using %* instead of "%1 %2 %3...". When I am passing in a list of aspect files and arguments this often means the input is truncated and not all of my aspects are compiled.

Workaround: edit the ajc.bat and replace the "%1 %2 %3..." list with "%*".

Reproducible: Always

Steps to Reproduce:
1. Run ajc.bat with more than 9 arguments, such as:
ajc.bat -source 1.6 -outxml -outjar out.jar src/MyAspect1.aj src/MyAspect2.aj src/MyAspect3.aj src/MyAspect4.aj src/MyAspect5.aj

src/MyAspect5.aj will not be included in the set of arguments passed to the AspectJ compiler, and so will not appear in the output jar or aop-ajc.xml
Comment 1 Andrew Clement CLA 2011-04-04 11:34:20 EDT
There is code to deal with this in the system that constructs the batch file (it is built during installation) - but it wasn't recognizing recent versions of windows (it was previously updated to support XP!). I've added Vista and Windows 7.
Comment 2 Iain McGinniss CLA 2011-04-04 11:39:47 EDT
Fast turnaround, thanks!