I am completely new to Python/Jython/PyDev.
I just tried to add a folder containing JARs as an External Source Folder to my Jython project as shown here: https://stackoverflow.com/a/12583946/2018047
Unfortunately, imports only resolved when adding the JARs individually (instead of their containing folder).
Do I have to add something like __init__.py files to those directories to make it work on a per folder basis? How are the init files structured?
In the manifest file for an eclipse plugin its possible to add jar files and
folders to the classpath (on the Runtime tab).
In the root of my plugin I have a folder lib containing a-1.0.1.jar, b-1.0.0-SNAPSHOT.jar. But only when I select each jar separately:
Bundle-ClassPath: .,
lib/a-1.0.1.jar,
lib/b-1.0.0-SNAPSHOT.jar
...can they be used inside my project. Why is it not possible to add them to the classpath by adding the common root folder only:
Bundle-ClassPath: .,
lib/
?
No, you can't. Eclipse is based on OSGi, which is the platform providing MANIFEST.MF support to build plugins.
When you set values under Bundle-ClassPath, OSGi search into each one to find class files. So you can put folders containing Java packages and class files. When you put a jar file, it is uncompressed in memory and viewed by OSGi as a regular folder, still searching for class files.
Unfortunately, there is no way to load all jar from a folder. No wildcard mechanism or something like that is allowed here.
I have a main project referencing a lib project. My lib project has some non-compiled files in a package "process/frameworks/".
I'm trying to get it so I can reference that project and have those non-compiled files copied over.
Here's what I've tried:
1) In my main project I go to
Properties -> Flex Build Path -> Add Project...
This will add the swc to my project and I'm able to reference the classes.
In my library project I go to
Properties -> Flex Library Build Path -> Assets
I then select the non-code files I want to include in my build.
This doesn't have the desired affect. The non-code files aren't copied into my bin-debug folder.
*Note, I've tried setting -Properties -> Project References -> {my lib project} That doesn't seem to do anything.*
2) In my main project I go to
Properties -> Flex Build Path -> Source Path
I then add my source path from my lib project. This works, but has two problems. First, since this project is in SVN, other developers have to have the same relative path {DOCUMENTS}\LibraryProject\src to the project. The other problem is that this library project gets compiled each time. I wish it would just copy over the asset files and use the swc if it doesn't need to be compiled again.
Does anyone know how to reference another project and have their non-code project files copied over?
My app folder is "app"
It contains both .pro and source files
It has a "bin" folder.
the "DESTDIR = bin\" in my .pro file
however, when building from Qt-Creator, a sibling folder is being created, called "app-build-desktop" and the binaries are stored there under a new "bin" folder.
why is this happening? why is another sibling folder being created and hosts a new bin folder instead of just creating the binary file in my existing "bin" folder.
In the "Projects" area (on the left pane of Qt Creator) there is a "Shadow build" option in the Build Settings. You can uncheck this to disable it.
That being said, it is a useful feature, for example for keeping your actual source directory clean of temporary files that you have to ignore in source control.
I am trying to create a jar file which includes some class and java files needed, but I also would like to include some extra xml, xsl, html, txt (README) files.
I am using Eclipse on Windows XP.
Is there an easy way for me to set up a directory structure and package all my files into a jar?
Add the files to a source folder and they can be included in the jar.
One common way is to have, at the root of your project, a src folder. Within that, folders for java files, and others. something like:
src/
css/
java/
html/
images/
Then you can make each of those subfolders a source folder (Right click, Use as Source Folder) and they should be available to add to the jar.
A .jar is nothing but a ZIP archive, so you can use any program capable of creating ZIPs. Just make sure that you include the manifest and all the class files.
I just added all the files into my Eclipse project (including the txt, html, xml, etc files).
Then I used Eclipse to File->Export->Jar File->Next
Check the "Export Java source files and resources" box.
Done.
If you're using Ant, you can use the jar task (see the examples section for how to include/exclude certain files, etc.)
If you move to an ANT (or Maven, for you Maven fans) then you can automate the Jar building very nicely, and also use it outside of Eclipse (e.g., in an automated build environment). All you need to do is copy the files from your src, jsp, foobar and resources locations into a build staging folder, then Jar the resulting files using ANT's Jar task.
<target name="makejar" depends="compile, copyfiles">
<jar destfile="${jars.dir}/myjarfile.jar" index="true" basedir="${build.dir}" />
</target>
One thing I look down on is including non-source (except package.html files for Javadoc) within the src folder. If you feel you have to do this to achieve something, then you are doing it wrong.