amottier / jeka

Automate with plain Java code and nothing else.

Home Page:https://jeka.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Maven Central Gitter Twitter Follow

                                             

What is Jeka ?

Jeka (formerly Jerkar) is a complete Java build system ala Ant, Maven or Gradle using Java as its main language instead of using XML or Groovy/Kotlin DSLs.

Build/task definitions are expressed with plain Java classes to leverage IDE power and Java ecosystem seamlessly.

Build scripts can be coded, modeled, run, debugged and reused as regular code.

Jeka offers an execution engine, a build API and a powerful plugin architecture to make your automation tasks a breeze.

Based on simple ideas

  • Run Java methods from both IDE and command line indifferently.
  • Simply use Java libraries for building Java projects programmatically.
  • Use standard plugins to implement/custom common tasks.

This is an example of a build class for a simple Springboot project.
@JkDefClasspath("dev.jeka:springboot-plugin:3.0.0.RC7")
class Build extends JkClass {

    private final JkPluginSpringboot springboot = getPlugin(JkPluginSpringboot.class);

    public boolean runIT = true;

    @Override
    protected void setup() {
        springboot.setSpringbootVersion("2.2.6.RELEASE");
        springboot.javaPlugin().getProject().simpleFacade()
            .setCompileDependencies(deps -> deps
                .and("org.springframework.boot:spring-boot-starter-web")
                .and("org.projectlombok:lombok:1.18.20")
            )
            .setRuntimeDependencies(deps -> deps
                .minus("org.projectlombok:lombok")
            )
            .setTestDependencies(deps -> deps
                .and("org.springframework.boot:spring-boot-starter-test")
                    .withLocalExclusions("org.junit.vintage:junit-vintage-engine")
            )
            .addTestExcludeFilterSuffixedBy("IT", !runIT);
    }

    public void cleanPack() {
        clean();
        springboot.javaPlugin().pack();
    }

}

To build the project, execute ´cleanPack´ from your IDE or execute the following command line.

/home/me/myproject>./jekaw cleanPack -runIT=false

User friendly

Thanks to wrapper and Jeka Plugin for Intellij, you don't need to install anything on your machine. You only need a JDK 8 or higher.

Getting started in 10 minutes : Here

News

  • Jeka 0.9.x serie is out. 0.9.x aims at providing intermediate API polishes and improvements prior to go to 1.0.0.alpha. It will also provide necessary features to interact with a first class Intellij plugin.

  • Jeka has joined OW2 organisation on january 2020 : https://projects.ow2.org/view/jeka/

Last major additions :

  • Reworked dependency management
  • Completely renewed API, now embracing widely Parent Chaining.
  • Test engine now relies on Junit 5 (still compatible with Junit 3&4)
  • Release of a plugin for Intellij
  • Upgraded to Ivy 2.5.0
  • Wrapper to run Jeka independently of the Jeka version installed on the host machine
  • Jdk9+ compatibility
  • Deploying on Maven central though a modern release process (version numbering based on Git instead of being hardcoded). Jeka now uses these features to release itself.

Roadmap/Ideas

  • Improve landing page and provide tutorials based on Intellij plugin for easy1/fast starting.
  • Stabilise api from user feedbacks. API is quite workable now but may be improved.
  • Enhance existing graphical plugin for Intellij
  • Integrate Kotlin as a first citizen language for both building Kotlin projects and write Jeka command classes.
  • Provide a plugin for Android
  • Provides a graphical plugin for better integration with Eclipse

Please visit release note and issues for roadmap.

Get Jeka

The distribution is the file named jeka-core-x.x.x-distrib.zip.

How to use Jeka ?

Jeka is designed to be easy to master for Java developers. It is easy to figure out how it works by knowing few concepts and navigate in source code.

That said, documentation is needed for a starting point.

Visit following pages according your expectation :

External plugins

Jeka comes with plugins out of the box. These plugins covers the most common points a Java developer need to address when building a project. This includes plugins for IDE metadata generation (IntelliJ, Eclipse), dependency management, git, , java project building, testing, PGP signing, binary repositories, Maven interaction, scaffolding, sonarQube and web archives.

Nevertheless, Jeka is extensible and other plugins exist outside the main distib among :

Community

Image

This project is supported by OW2 consortium.

You can ask question using regular using this repository issues.

You can also use direct emailing for questions and support : djeangdev@yahoo.fr

A twitter account also exist : https://twitter.com/djeang_dev

How to build Jeka ?

Jeka is made of following projects :

  • dev.jeka.core : complete Jeka project
  • dev.jeka.samples : A sample project with several build classes to illustrate how Jeka can be used in different ways
  • dev.jeka.depender-samples : A sample project depending on the above sample project to illustrate multi-project builds. These sample projects are also used to run some black-box tests

Jeka builds itself. To build Jeka full distrib from sources, the simpler is to use your IDE.

Once distrib created, add the distrib folder to your PATH environment variable.

Build Jeka from Eclipse

  • Clone this repository in Eclipse. Project is already configured ( .project and .classpath are stored in git).
  • Add the JEKA_USER_HOME classpath variable pointing on [USER_HOME]/.jeka
  • Make sure the project is configured to compile using a JDK8 or higher and not a JRE.
  • Run dev.jeka.core.CoreBuildAndIT class main method. This class is located in jeka/def folder.
  • This creates the full distrib in dev.jeka.core/jeka/output/distrib folder and run full Integration test suite.

Build Jeka from IntelliJ

Note that it exists a now an IntelliJ plugin to integrate Jeka to get rid of the following setup.

  • Clone this repository into IntelliJ. Project is already configured (.iml and modules.xml are stored in git).
  • Add the JEKA_USER_HOME variable pointing on [USER_HOME]/.jeka
  • Make sure the project is configured with a JDK8 or higher.
  • Run dev.jeka.core.CoreBuildAndIT class main method. This class is located in jeka/def folder, inside dev.jeka.core module. Make sure to run it using $MODULE_WORKING_DIR$ as working directory.
  • This creates the full distrib in dev.jeka.core/jeka/output/distrib folder and run full Integration test suite.

To build the project without running whole integration test suite, run dev.jeka.core.CoreBuild class main method.

How to Release ?

Release is done automatically by Github action on PUSH on master. If the last commit message title contains a word like 'Release:XXX' (case matters ) then a tag XXX is created and the binaries will be published on Maven Central. Otherwise, the binary wll be simply pushed on OSSRH snapshot.

To really deploy to Maven central, a manual action it still needed to close/release repository.

                                             

About

Automate with plain Java code and nothing else.

https://jeka.dev

License:Apache License 2.0


Languages

Language:Java 97.7%Language:Shell 1.1%Language:CSS 0.7%Language:Vim Snippet 0.3%Language:Batchfile 0.2%Language:HTML 0.0%