litesoft
Diff Revisions
292
vs
293
for /trunk/Java/ScarPlus/src/com/esotericsoftware/scar/Scar.java
|
@@ -36,15 +36,22 @@ |
36 |
36 |
|
|
37 |
37 |
|
protected final ProjectCache mProjectCache = new ProjectCache(); |
38 |
38 |
|
|
|
39 |
+ |
private Project mLaunchProject; |
|
40 |
+ |
|
39 |
41 |
|
/** |
40 |
42 |
|
* The command line arguments Scar was started with. Empty if Scar was started with no arguments or Scar was not started from |
41 |
43 |
|
* the command line. |
42 |
44 |
|
*/ |
43 |
|
- |
public final Arguments args; |
|
45 |
+ |
public final Arguments mArgs; |
44 |
46 |
|
|
45 |
47 |
|
public Scar( Arguments pArgs ) |
46 |
48 |
|
{ |
47 |
|
- |
this.args = (pArgs != null) ? pArgs : new Arguments(); |
|
49 |
+ |
mArgs = (pArgs != null) ? pArgs : new Arguments(); |
|
50 |
+ |
} |
|
51 |
+ |
|
|
52 |
+ |
public Project getLaunchProject() |
|
53 |
+ |
{ |
|
54 |
+ |
return mLaunchProject; |
48 |
55 |
|
} |
49 |
56 |
|
|
50 |
57 |
|
/** |
|
@@ -333,7 +340,7 @@ |
333 |
340 |
|
String[] zLevels = LoggerLevel.LEVELS; |
334 |
341 |
|
for ( int i = 0; i < zLevels.length; i++ ) |
335 |
342 |
|
{ |
336 |
|
- |
if ( null != args.get( zLevels[i] ) ) |
|
343 |
+ |
if ( null != mArgs.get( zLevels[i] ) ) |
337 |
344 |
|
{ |
338 |
345 |
|
zLevel = i; |
339 |
346 |
|
break; |
|
@@ -1746,14 +1753,39 @@ |
1746 |
1753 |
|
} |
1747 |
1754 |
|
} |
1748 |
1755 |
|
|
|
1756 |
+ |
protected void executeMethod( String pMethodName ) |
|
1757 |
+ |
throws IOException |
|
1758 |
+ |
{ |
|
1759 |
+ |
// todo: use reflection to call method |
|
1760 |
+ |
} |
|
1761 |
+ |
|
|
1762 |
+ |
protected void createLaunchProject() |
|
1763 |
+ |
throws IOException |
|
1764 |
+ |
{ |
|
1765 |
+ |
mLaunchProject = project( mArgs.get( "file", "." ) ); |
|
1766 |
+ |
} |
|
1767 |
+ |
|
|
1768 |
+ |
protected void run() |
|
1769 |
+ |
throws IOException |
|
1770 |
+ |
{ |
|
1771 |
+ |
if ( mArgs.count() == 0 ) |
|
1772 |
+ |
{ |
|
1773 |
+ |
mLaunchProject.build(); |
|
1774 |
+ |
return; |
|
1775 |
+ |
} |
|
1776 |
+ |
for ( Arguments.NameValuePair zPair ; null != (zPair = mArgs.getNext()); ) |
|
1777 |
+ |
{ |
|
1778 |
+ |
executeMethod( zPair.getName() ); |
|
1779 |
+ |
} |
|
1780 |
+ |
} |
|
1781 |
+ |
|
1749 |
1782 |
|
public static void main( String[] args ) |
1750 |
1783 |
|
throws Exception |
1751 |
1784 |
|
{ |
1752 |
1785 |
|
Arguments arguments = new Arguments( args ); |
1753 |
1786 |
|
Scar scar = new Scar( arguments ); |
1754 |
1787 |
|
scar.initLoggerFactory(); |
1755 |
|
- |
|
1756 |
|
- |
Project project = scar.project( arguments.get( "file", "." ) ); |
1757 |
|
- |
project.build(); |
|
1788 |
+ |
scar.createLaunchProject(); |
|
1789 |
+ |
scar.run( ); |
1758 |
1790 |
|
} |
1759 |
1791 |
|
} |