how to create build steps in Eclipse? - eclipse

I am trying to add build steps in an Eclipse project (Eclipse CDT Version: 3.8.0 on Debian).
For instance, when instructing Eclipse to build it would:
1- Run premake
2- Run make
You get the gist.
There's 0 tutorials on the subject and I looked everywhere... Is it because this feature doesn't exist? That's hard to believe...

There is no tutorial for Eclipse build :D
May be you want to build your project? Correct me if I am wrong.
As I know, Eclipse supports us to use Ant build to build/ execute the build step for projects (not for Eclipse itself) => build.xml
And If you really want to do some things else, i think create a bat file. and then execute it when start Eclipse is a suggestion.

Related

Process of install the Junit library in Eclipse

Good morning guys,
what I am considering about is to build a standard process of installing a library in a java project in eclipse. I am a niewbie software developer so a prior sorry if this question is a bit stupid.
All what I want to do is to use the junit library. I have followed these septs.
I installed the junit-4.12.jar file from the web.
Inside the project folder I created a new file and I named it "lib".
I put in this folder thae jar file and then in eclipse I click
on project folder -> properties -> Java build path and I click on libraries and add jars. (not external jars).
Is that process ok?
your process isn't good because it doesn't scale: imagine you want to install 40 libraries in your project. and then imaging your team has 5 developers and each of them has to do the same. and what about CI server that must be automatic
in fact your problem was solved years ago and the solution is called 'dependency management tool'. those tools are usually built into something more powerful called 'build tool'. maven or gradle are examples of such tools. you just provide list of your dependencies (like junit) and that program automatically downloads them and build your project. and it's sufficient as long as your project is more less 'typical'
i don't remember if eclipse has build in support for maven (one of the oldest and most common). if not, just install the eclipse plugin and you're ready to go

Eclipse running lift project (project configuration issues)

Trying to get a lift project to run on windows, I've installed maven on my computer, then tried to use
mvn archetype:generate from cmd, then chose the lift basic one , but it always failed on the jetty:run part. Before that, I had to change a lot of the pom.xml file to even get a successful build (since the tutorial I was using was obsolete and it couldn't find the dependencies).
So I've decided to try with the eclipse plugin, thinking it should be easier.
I've installed the maven plugin for eclipse and created a project with the lift archetype.
The project was succesfully created, but I have all kinds of errors in the editor for missing ; and so on (I have scala ide installed on eclipse also and creating a normal scala project works and compiles/runs fine). I have also tried to include the scala-library.jar in the buildpath, with no change.
The odd part is that I can run the cmd and go to the project folder, then run mvn jetty:run and it will actually work (?!) Trying to run in eclipse with jetty:run as goal will give me ClassNotFoundException on the HelloWorld snippet.
So what might be wrong with my settings?
UPDATE: no luck whatsoever, after trying 3 different eclipse versions, installing the maven for scala plugin and following every tutorial I could find. It just simply feels all is outdated on the instructions:
this is how it looks after I include the scala libraries for eclipse on every project (after I create it from an archetype):
is this "mvn archetype:generate" up to date? I don't know if anybody guarantees it will work at all..
Anyway, the default way to at least try Lift and see it working is the following: https://github.com/lift/lift_25_sbt
It uses "Simple Build Tool" instead of maven, but maven should work, too. Also, you can easily read "build.sbt" to get all the dependencies.
Plugins for creating eclipse/intellij project definitions are included. (See the README of the demo project.)
The target to create eclipse project is "eclipse" or "eclipse with-sources=true".
The target to launch the app is "container:start".

How to build and install an Eclipse plugin using ant

How do I build and install an Eclipse plugin using ant? I want to build a plugin as a zip file and then install the plugin on 32bit or 64bit eclipse. What am I supposed to do here?
Indeed, using PDE/Build to achieve a so-called headless build is difficult, but not impossible.
We are still building our RCP this way.
I recommend reading Paulin's and Sharma's tutorials on the issue.
The Eclipse PDE has its own builder which is built on ant. I'm not sure from your question if you are looking to simply build/export your plugin within eclipse or generate ant build scripts that can be run outside of eclipse. The latter is more difficult. Inside eclipse you can simple go to file -> export -> Plugin-Development -> Deployable plugin and the export wizard will walk you through it, you can select to deploy a zip or exploded directory and then select output location and presto you have your plugin built as a jar that can be dropped into an eclipse instance. If you are looking to use ant outside of eclipse to build you need to go through a series of steps that are complicated to get a 'headless build", if this is what you need to do Google "pde headless" build. I've tried it but gave up. There is also a good book "Building highly modular systems with OSGI/Equinox that has a chapter devoted to this. - Duncan

Automating the deployment process of plugin

I have an eclipse plugin, when I deploy it, I use a feature project then export through the wizard to get zip file to install in any eclipse based app.
How can I automate this ?
I want the whole process to run automatically.
Use the PDE Build stuff, also see the documentation.

Can eclipse be used to fully replace ant?

I don't want to build the files manually with command line,
is it possible for eclipse to do the equivalent for tomcat automatically?
eclipse by default does compile your project automatically. Do you mean to have eclipse deploying to tomcat automatically?
If that is what you would like to do, Eclipse WebTools has support for deploying to servlet container. One example of how to do that is http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
If you have a build.xml file in your project root, you can right click on it in eclipse, select Run As -> Ant Build...
From there you can configure how it should run the script just as if you were using ant.
Question title
Can eclipse be used to fully replace ant?
Short answer: Do not compare apples with oranges.
Eclipse IDE (Building is one of its feature). Wiki
Ant Build tool. Wiki
Tomcat Webserver. Wiki