How to add package declaration in java generated by SWIG

I use SWIG to create a heap of Java files - I want the files to be part of a specific package ... right now, after I generated them, I need to go in and manually add an import declaration .. Is there a way to create a template in swig?

+5
source share
1 answer

You just need to specify the package as follows

mkdir -p com/example/package
swig -java -package com.example.package -outdir com/example/package example.i
+8
source

All Articles