From fb0fba2f15f4e51628bf2d33d7afa5a7247fcf85 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Fri, 30 Oct 2009 11:53:11 +0100 Subject: Added comments to NarSystem generated file; Fixed NAR-19 --- .../org/apache/maven/plugin/nar/NarSystemGenerate.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/apache/maven/plugin/nar/NarSystemGenerate.java b/src/main/java/org/apache/maven/plugin/nar/NarSystemGenerate.java index e3c8161..d33df60 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarSystemGenerate.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarSystemGenerate.java @@ -80,11 +80,18 @@ public class NarSystemGenerate getLog().info("Generating "+narSystem); try { + String artifactId = getMavenProject().getArtifactId(); + String version = getMavenProject().getVersion(); FileOutputStream fos = new FileOutputStream( narSystem ); PrintWriter p = new PrintWriter( fos ); p.println( "// DO NOT EDIT: Generated by NarSystemGenerate." ); p.println( "package " + packageName + ";" ); p.println( "" ); + p.println( "/**" ); + p.println( " * Generated class to load the correct version of the jni library" ); + p.println( " *" ); + p.println( " * @author maven-nar-plugin" ); + p.println( " */" ); p.println( "public class NarSystem" ); p.println( "{" ); p.println( "" ); @@ -92,10 +99,15 @@ public class NarSystemGenerate p.println( " {" ); p.println( " }" ); p.println( "" ); + p.println( " /**" ); + p.println( " * Load jni library: "+artifactId+"-"+version ); + p.println( " *" ); + p.println( " * @author maven-nar-plugin" ); + p.println( " */" ); p.println( " public static void loadLibrary()" ); p.println( " {" ); - p.println( " System.loadLibrary(\"" + getMavenProject().getArtifactId() + "-" - + getMavenProject().getVersion() + "\");" ); + p.println( " System.loadLibrary(\"" + artifactId + "-" + + version + "\");" ); p.println( " }" ); p.println( "}" ); p.close(); -- cgit v1.2.3