Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify "Compiling" info message: display relative path #250

Merged
merged 2 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,11 @@ public CompilerResult performCompile( CompilerConfiguration config )
return new CompilerResult();
}

String to = ( config.getWorkingDirectory() == null ) ? config.getOutputLocation() :
config.getWorkingDirectory().toPath().relativize( destinationDir.toPath() ).toString();
System.out.println(
"Compiling " + sourceFiles.length + " " + "source file" + ( sourceFiles.length == 1 ? "" : "s" ) + " to "
+ destinationDir.getAbsolutePath() );
+ to );

// String[] args = buildCompilerArguments( config, sourceFiles );
AjBuildConfig buildConfig = buildCompilerConfig( config );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ public CompilerResult performCompile( CompilerConfiguration config )

if ( ( getLogger() != null ) && getLogger().isInfoEnabled() )
{
String to = ( config.getWorkingDirectory() == null ) ? config.getOutputLocation() :
config.getWorkingDirectory().toPath().relativize( destinationDir.toPath() ).toString();
getLogger().info( "Compiling " + sourceFiles.length + " " +
"source file" + ( sourceFiles.length == 1 ? "" : "s" ) +
" to " + destinationDir.getAbsolutePath() );
" to " + to );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these duplications be avoided?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these duplications be avoided?

?? not sure to understand your concern?

Copy link
Member Author

@hboutemy hboutemy Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean create a logCompiling() method in AbstractCompiler for logging, and have plexus compilers use this method?

https://codehaus-plexus.github.io/plexus-compiler/plexus-compiler-api/apidocs/org/codehaus/plexus/compiler/AbstractCompiler.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to and message logged/being output are calculated twice (Javac, AspecJCompiler) in the same way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, done in 37f6843

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

}

String[] args = buildCompilerArguments( config, sourceFiles );
Expand Down