processing / processing-library-template-ant

Processing Library Template for Eclipse
Other
141 stars 447 forks source link

Prevent massive import lines? #28

Closed sphaero closed 4 years ago

sphaero commented 4 years ago

When I create a library with this template and lots of source code I end up with the Processing IDE to generate lots of import statements. How can I prevent these, as they are not needed!

import de.quippy.javamod.io.*;
import de.quippy.javamod.io.wav.*;
import de.quippy.javamod.main.*;
import de.quippy.javamod.main.applet.*;
import de.quippy.javamod.main.gui.*;
import de.quippy.javamod.main.gui.components.*;
import de.quippy.javamod.main.gui.playlist.*;
import de.quippy.javamod.main.gui.tools.*;
import de.quippy.javamod.main.playlist.*;
import de.quippy.javamod.main.playlist.cuesheet.*;
import de.quippy.javamod.mixer.*;
import de.quippy.javamod.mixer.dsp.*;
import de.quippy.javamod.mixer.dsp.iir.*;
import de.quippy.javamod.mixer.dsp.iir.filter.*;
import de.quippy.javamod.mixer.dsp.pitchshift.*;
import de.quippy.javamod.multimedia.*;
import de.quippy.javamod.multimedia.ape.*;
import de.quippy.javamod.multimedia.flac.*;
import de.quippy.javamod.multimedia.midi.*;
import de.quippy.javamod.multimedia.mod.*;
import de.quippy.javamod.multimedia.mod.loader.*;
import de.quippy.javamod.multimedia.mod.loader.instrument.*;
import de.quippy.javamod.multimedia.mod.loader.pattern.*;
import de.quippy.javamod.multimedia.mod.loader.tracker.*;
import de.quippy.javamod.multimedia.mod.mixer.*;
import de.quippy.javamod.multimedia.mod.mixer.interpolation.*;
import de.quippy.javamod.multimedia.mp3.*;
import de.quippy.javamod.multimedia.mp3.id3.*;
import de.quippy.javamod.multimedia.mp3.id3.exceptions.*;
import de.quippy.javamod.multimedia.mp3.streaming.*;
import de.quippy.javamod.multimedia.ogg.*;
import de.quippy.javamod.multimedia.ogg.metadata.*;
import de.quippy.javamod.multimedia.sid.*;
import de.quippy.javamod.multimedia.wav.*;
import de.quippy.javamod.system.*;
import de.quippy.javamod.test.*;
import de.quippy.jflac.*;
import de.quippy.jflac.frame.*;
import de.quippy.jflac.io.*;
import de.quippy.jflac.metadata.*;
import de.quippy.jflac.util.*;
import de.quippy.jmac.decoder.*;
import de.quippy.jmac.info.*;
import de.quippy.jmac.prediction.*;
import de.quippy.jmac.tools.*;
import de.quippy.mp3.decoder.*;
import de.quippy.ogg.jogg.*;
import de.quippy.ogg.jorbis.*;
import de.quippy.sidplay.libsidplay.*;
import de.quippy.sidplay.libsidplay.common.*;
import de.quippy.sidplay.libsidplay.common.mos6510.*;
import de.quippy.sidplay.libsidplay.components.mos6526.*;
import de.quippy.sidplay.libsidplay.components.mos656x.*;
import de.quippy.sidplay.libsidplay.components.sidtune.*;
import de.quippy.sidplay.libsidplay.components.xsid.*;
import de.quippy.sidplay.libsidplay.mem.*;
import de.quippy.sidplay.resid_builder.*;
import de.quippy.sidplay.resid_builder.resid.*;
import procmod.*;

For reference the lib is located here: https://github.com/sphaero/procmod

I guess it's caused by a package source being included in the src folder?

Any pointers really appreciated.

jeremydouglass commented 4 years ago

Seems like you aren't putting your libraries in /lib?

https://github.com/sphaero/procmod/tree/master/lib

The lib folder: In case your Library requires 3rd party libraries, which need to be added to the distribution, put them into the lib folder. These 3rd party libraries will be added to your distribution and are located next to your Library's jar file. This does not apply to .jar files that are considered core processing libraries.

sphaero commented 4 years ago

No I put the source of the lib in /src. I thought the /lib folder was meant for .jar files. If I put the source in lib I get errors.


compile:
    [javac] Compiling 1 source file to /home/arnaud/src/procmod/bin
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 8
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:13: error: package de.quippy.javamod.main does not exist
    [javac] import de.quippy.javamod.main.JavaModMainBase;
    [javac]                              ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:14: error: package de.quippy.javamod.main.gui does not exist
    [javac] import de.quippy.javamod.main.gui.PlayThread;
    [javac]                                  ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:15: error: package de.quippy.javamod.main.gui does not exist
    [javac] import de.quippy.javamod.main.gui.PlayThreadEventListener;
    [javac]                                  ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:16: error: package de.quippy.javamod.main.playlist does not exist
    [javac] import de.quippy.javamod.main.playlist.PlayList;
    [javac]                                       ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:17: error: package de.quippy.javamod.mixer does not exist
    [javac] import de.quippy.javamod.mixer.Mixer;
    [javac]                               ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:18: error: package de.quippy.javamod.multimedia does not exist
    [javac] import de.quippy.javamod.multimedia.MultimediaContainer;
    [javac]                                    ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:19: error: package de.quippy.javamod.multimedia does not exist
    [javac] import de.quippy.javamod.multimedia.MultimediaContainerManager;
    [javac]                                    ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:20: error: package de.quippy.javamod.multimedia.mod does not exist
    [javac] import de.quippy.javamod.multimedia.mod.ModContainer;
    [javac]                                        ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:22: error: package de.quippy.javamod.system does not exist
    [javac] import de.quippy.javamod.system.Log;
    [javac]                                ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:36: error: cannot find symbol
    [javac] public class ModPlayer extends JavaModMainBase implements PlayThreadEventListener
    [javac]                                ^
    [javac]   symbol: class JavaModMainBase
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:36: error: cannot find symbol
    [javac] public class ModPlayer extends JavaModMainBase implements PlayThreadEventListener
    [javac]                                                           ^
    [javac]   symbol: class PlayThreadEventListener
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:49: error: cannot find symbol
    [javac]     public MultimediaContainer currentContainer;
    [javac]            ^
    [javac]   symbol:   class MultimediaContainer
    [javac]   location: class ModPlayer
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:51: error: cannot find symbol
    [javac]     private PlayThread playerThread = null;
    [javac]             ^
    [javac]   symbol:   class PlayThread
    [javac]   location: class ModPlayer
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:52: error: cannot find symbol
    [javac]     private PlayList currentPlayList = null;
    [javac]             ^
    [javac]   symbol:   class PlayList
    [javac]   location: class ModPlayer
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:188: error: cannot find symbol
    [javac]     private Mixer createNewMixer()
    [javac]             ^
    [javac]   symbol:   class Mixer
    [javac]   location: class ModPlayer
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:198: error: cannot find symbol
    [javac]     public void playThreadEventOccured(PlayThread thread)
    [javac]                                        ^
    [javac]   symbol:   class PlayThread
    [javac]   location: class ModPlayer
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:203: error: cannot find symbol
    [javac]     public void mixerEventOccured(int rowIndex, PatternRow row) 
    [javac]                                                 ^
    [javac]   symbol:   class PatternRow
    [javac]   location: class ModPlayer
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:21: error: package de.quippy.javamod.multimedia.mod.loader.pattern does not exist
    [javac] import de.quippy.javamod.multimedia.mod.loader.pattern.*;
    [javac] ^
    [javac] /home/arnaud/src/procmod/tmp/procmod/src/procmod/ModPlayer.java:77: error: cannot find symbol
    [javac]                 Log.error("This is not parsable: " + modFile, ex);
    [javac]                 ^
    [javac]   symbol:   variable Log
    [javac]   location: class ModPlayer
   ....
jeremydouglass commented 4 years ago

I believe that the /lib folder is meant for third-party libraries as jar files. You don't need to include them as source -- you can include the jars.

For example, it looks like you are trying to include javamod. So you might want to include javamod.jar -- not the full source code of javamod.

https://www.quippy.de/mod_en.php

sphaero commented 4 years ago

Yes indeed. It is a heaviliy modified version of javamod to make it usable for processing. I rather keep the source together.

jeremydouglass commented 4 years ago

Got it. If you really don't want a separate eclipse project for your custom javamod, then put your javamod source in e.g. /lib-src and make a new separate Eclipse build action that builds the jar to /lib. Add it to the beginning of build all if you want to rebuild the jar each time you rebuild your library.

sphaero commented 4 years ago

Ok, thanks for thinking along. I've moved the package to its own subdir and added a build target to the ant file.