How to add *junit* to *spec.libraries* in generated podspec? - j2objc-gradle

I am using the Gradle J2ObjC plugin to translate Java code in the pure-Java modules of my project to Objective-C. I have a need for the generated podspec file in the build/j2objcOutputs folder of one of my Java modules to contain a junit entry in the spec.libraries list. Currently it is defined as follows:
spec.libraries = 'ObjC', 'guava', 'javax_inject', 'jre_emul', 'jsr305', 'z', 'icucore'
Is there something that I can add to the build.gradle file of my Java module to make this possible?

I have been unable to figure out how to do this with the J2Objc Gradle plugin and have had to resort to putting the following in the "Other linker flags" in Xcode for my tests target:
$(inherited)
-l"junit"
I'm marking this as the solution until someone can suggest otherwise.

Related

How to expose an Objective-C Module properly using Bazel?

I'm trying to build RxSwift using Bazel in order to be able to use it in a dummy project as a dependency, for the sake of getting to know it a bit.
We don't use the latest RxSwift version at the moment, but version 4.4.2.
After reading through the docs, I've come to the point where I successfully add the specific release to my workspace as an http_archive, and supply my own BUILD file to build that external dependency RxSwift.
You can check out the BUILD file and WORKSPACE file here:
https://gist.github.com/daneov/487444109c703087862d830a3445ee86
Running
bazel build #rx_swift//:RxSwift
yields a Swift compilation error:
No such module: RxAtomic
So, this shows that my I'm missing something with regards to exposing the Objective-C module to a Swift library.
I currently supply these options to the objc_framework:
enable_modules = 1,
alwayslink = 1,
module_name = "RxAtomic"
Thanks in advance for any thoughts/pointers!
You should call bazel build with --experimental_objc_enable_module_maps option

Eclipse and qmake

This is my first message on this forum… so hello at all..
I have to make c++ project with Eclipse IDE and using QT library… and I want to integrate QT library…
So I have downloaded Eclipse and QT version 5.1.0, included the library and all work…My problem born when I try to integrate qmake in eclipse for using moc compiler… I followed this procedure www.qtcentre.org/wiki/index.php?title=How_to_use_Eclipse_with_Qt4_in_10_steps.. but doesn't work…
Could someone help me?
Thanks
Sorry. I try to explain better the problem...
After installing eclipse with O.S. windows I have created a new project:
1) File->new->c++ Project (inserted the project name) and selected MinGW GCC as toolchains and debug and release as configurations
2)Project->Properties-> C/C++ Build->Settings->GCC C++ Compiler->Includes .. I included the path of may Qt library
3)Project->Properties-> C/C++ Build->Settings->MinGW C++ Linker-> LIbraries I included the link to the libraries.
4)I have created my file project called main.cpp and the header and cpp for my class (testclass1.h testclass1.cpp)
5) My class is a deriverd class of QObject and since I have to use signal and slot I need of Q_OBJECT macro.
6) Run->External ToolsConfigrations I created two new Programs.
.Name:Qmake
.Location .../bin/qmake
.Name:QtAssistant
.Location .../bin/assistant
7)Created a new target in my "Make target"
Target Name: qmake
Make Target: myQtProj.pro
Build Command: qmake
Target Name: all
Make Target: all
Build Command: default (make)
8) when I run qmake I have this error: undefined reference to `vtable for testclass1..I thinks that this depends on the macro Q_OBJECT.. I expect that running qmake the moc compiler is called so I should have in testclass1.cpp the macro Q_OBJECT "expanded"..
At the moment I solved the problem in this manner(from command line I called):
qmake -project (create myproject.pro)
qmake (create a makefile)
mingw32-make that create moc_testclass1.cpp...
So I copy the content of moc_testclass1.cpp in my testclass1... and I can build the project and all work. But this is not and automated way..
I hope to be more clear in my description.
Thanks for your help.

cant compile ast parser code in java

I have some ast parser code in eclipse but I am unable to import the
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
packages.
could some body tell me which jar file to download and where to add same that jar file in eclipse folder.
You probably have those files downloaded already in eclipse\plugins folder i.e. in windows C:\Program Files\eclipse\plugins\org.eclipse.jdt.core_3.9.1.v20130905-0837.jar
Of course you can download from internet as well
http://central.maven.org/maven2/org/eclipse/tycho/org.eclipse.jdt.core/
Note that in order to run it as a stand alone application you will have to import such librariers (where xx stands for version and again they can be found in eclipse\plugins folder):
org.eclipse.core.contenttype_xx.jar
org.eclipse.core.jobs_xx.jar
org.eclipse.core.resources_xx.jar
org.eclipse.core.runtime_xx.jar
org.eclipse.equinox.common_xx.jar
org.eclipse.equinox.preferences_xx.jar
org.eclipse.jdt.core_xx.jar
org.eclipse.osgi_xx.jar
Usually people add other libraries in folder called lib but still you will have to set it in eclipse. In order to do that right click on your project then build path -> configure build path -> libraries and select add JAR.

How to include predefined set of netbeans platform modules in maven project?

I am working on maven netbeans platform project consisting of several modules. I need to depend on some modules (say java.source module), but when I try to run the application, it reports, that required modules are not installed. And event despite I have dependency on java.source declared in my pom.xml
I think, that I have to tell maven somehow, to install (and turn on) these modules in the final assembled application before my module is loaded.
How could I do something like this?
UPDATE:
When I try to create complete netbeans application project from maven artifact and add Java Source API as a dependency into pom.xml... when I run the application, window with following message appears:
Warning - could not install some modules: Editor Library 2 - None of the modules providing the capability org.netbeans.modules.editor.actions could be installed. Editor Indentation for Projects - The module named org.netbeans.modules.editor.settings.storage/1 was needed and not found. Editor Indentation for Projects - The module named org.netbeans.modules.options.editor/1 was needed and not found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ActionsFactory could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.OpenProjectsTrampoline could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ProjectChooserFactory could be found. Editor Error Stripe Impl - The module named org.netbeans.modules.editor.errorstripe.api/1 was needed and not found. Java Source - The module named org.netbeans.libs.javacimpl/1 was needed and not found. Java Source - The module named org.netbeans.modules.editor.indent.project/0-1 was needed and not found. Java Source - The module named org.netbeans.modules.java.preprocessorbridge was needed and not found. Java Source - The module named org.netbeans.modules.options.editor/1 was needed and not found. Java Source - The module named org.netbeans.modules.parsing.api/1 was needed and not found. Editor Settings - No module providing the capability org.netbeans.api.editor.settings.implementation could be found. Diff - The module named org.netbeans.modules.options.editor/1 was needed and not found. 11 further modules could not be installed due to the above problems.
The error-message "Module dependency has friend dependency [...] but is not listed as friend" means that you need to specify an implementation version of org.netbeans.modules.options.editor.
You can achieve this by editing src/main/nbm/module.xml to contain the following entry (I didn't use the actually needed values here. Make sure to find out which values to enter for id and explicitValue to satisfy the dependencies (You can find explanations / instructions in the article linked below):
<dependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-editor</id>
<type>impl</type>
<explicitValue>org.netbeans.modules.editor/1 = 201107282000</explicitValue>
</dependency>
</dependencies>
I'm pretty sure that the following article will explain some issues and help you find out the needed values for id and explicitValue (language is english, author is me):
http://blog.macrominds.de/2011/08/open-favorites-per-default-in-netbeans-rich-client-platform-maven-standalone-application/
I'm currently having related problems with my application, so I might come back with a more concrete solution in a while.
the easiest way is to grab a class that its complaining about, say "org.netbeans.modules.editor.actions" and go to the Add Dependencies and plug it into the Query field.
From there you should be able to tell which module you will need to include

Flex compiler error: "please put definition in a package" for classes that ARE in a package

This is with Flexbuilder 3.2, Eclipse 3.3.2.
I am moving my development environment to a new machine. Actionscript classes that compiled in the old environment now get a compile error:
A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the definition in a package.
I do declare the package in these classes - I think failure to declare the package is the usual reason for this error.
To add to the mystery, many classes in this project compile without errors.
What should I check to diagnose this?
Problem solved - I had missed out some items in the path in the environment where I was launching Eclipse.
"C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0"\bin
"C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0"\frameworks
"C:\Program Files\Adobe\Flex Builder 3 Plug-in\jre"\bin
"C:\Program Files\Adobe\Flex Builder 3 Plug-in\jre"\lib
I'm amazed anything at all worked with this much missing from my path.