Skip to content

Commit

Permalink
dont use nativecodegen config for generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Ski committed Jul 10, 2024
1 parent 78d92ee commit 0345376
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class JnigenExtension {
public JnigenExtension (Project project) {
this.project = project;
this.subProjectDir = project.getProjectDir().getAbsolutePath() + File.separator;
this.nativeCodeGeneratorConfig = new NativeCodeGeneratorConfig(project, jniDir);
this.nativeCodeGeneratorConfig = new NativeCodeGeneratorConfig(project);
}

public void nativeCodeGenerator (Action<NativeCodeGeneratorConfig> container) {
Expand Down Expand Up @@ -268,15 +268,13 @@ public void each (Predicate<BuildTarget> condition, Action<BuildTarget> containe
class NativeCodeGeneratorConfig {
SourceSet sourceSet;
private String[] sourceDirs;
String jniDir = "jni";
String[] includes = null;
String[] excludes = null;

public NativeCodeGeneratorConfig (Project project, String jniDir) {
public NativeCodeGeneratorConfig (Project project) {
JavaPluginConvention javaPlugin = project.getConvention().getPlugin(JavaPluginConvention.class);
SourceSetContainer sourceSets = javaPlugin.getSourceSets();
sourceSet = sourceSets.findByName("main");
this.jniDir = jniDir;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void run () {
.forEach(s -> {
try {
new NativeCodeGenerator().generate(s,
ext.nativeCodeGeneratorConfig.sourceSet.getRuntimeClasspath().getAsPath(), ext.subProjectDir + ext.nativeCodeGeneratorConfig.jniDir,
ext.nativeCodeGeneratorConfig.sourceSet.getRuntimeClasspath().getAsPath(), ext.subProjectDir + ext.jniDir,
ext.nativeCodeGeneratorConfig.includes, ext.nativeCodeGeneratorConfig.excludes);
} catch (Exception e) {
throw new RuntimeException("NativeCodeGenerator threw exception", e);
Expand Down

0 comments on commit 0345376

Please sign in to comment.