ddekany / jbosstools-freemarker

JBoss Tools :: Freemarker { freemarker }
17 stars 4 forks source link

FreeMarker IDE Eclipse plugin

Summary

Please note: This is a maintenance fork of the discontinued JBoss Tools FreeMarker plugin, which was developed at JBoss (Red Hat), not by me.

This is an Eclipse pluging that provides an editor for Apache FreeMarker .ftl (and .ftlh, .ftlx, etc.) files with syntax error markers as you type, syntax highlighting (for the template language only), and some code completion.

If you are looking at the fork of user ddekany, then the last released version should be on the Eclipse Marketplace here, or directly from the update site. If these are unavailable for some reason, the plugin can be downloaded from the Github release page.

Building

This command will run the build:

$ mvn clean verify

If you just want to check if things compiles/builds you can run:

$ mvn clean verify -DskipTest=true

While this project is not part of JBoss Tools anymore, this is still possibly relevant: How to Build JBoss Tools with Maven 3

Install

If the latest version is not on Eclipse Marketplace, then build it like above, and then in Eclipse "Help" / "Install New Software..." / "Add...", and point to jbosstools-freemarker\site\target\repository, then select "FreeMarker IDE".

Develop

  1. It's recommended to download and install "Eclipse for committers" instead of a regular Eclipse.
  2. Install plugins needed for running the tests:
    1. jbosstools-base:
      • Get it from https://github.com/jbosstools/jbosstools-base.
      • Build it: mvn verify -DskipTests=true
      • In Eclipse "Install new software" from location, jbosstools-base\site\target\repository, and select "JBoss Tools Test Framework"
    2. jbosstools-locus:
  3. Add a default "API Baseline" in Eclipse under "Window" / "Preferences".
  4. Eclipse: Import jbosstools-freemarker as Eclipse projects, NOT as Maven project (Maven is only to build in CI or from command line)!
  5. Eclipse will complain about some lines of pom.xml; on the same place it will offer installing the missing Maven connectors (Tycho, etc.), so do that.

Note: On Mars, if after running JUnit tests it starts to log "AERI failed with an error." stack traces in infinite loop, this to eclipse.ini: -Dorg.eclipse.epp.logging.aeri.ui.skipReports=true (See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=488868)

Release

Maven release plugin didn't work for some reason, and anyway we need to change OSGi versions in MANIFEST.MF-s too, so I just do this:

# It's assumed that the version number is already on $releaseVersion-SNAPSHOT. That was also set by these commands, if they were used for the previous release, as you will see later.
releaseVersion='1.5.303'
nextVersion='1.5.304'

# Attention: You must be in the project root directory!
find -type f -name "pom.xml" -not -path '*/target/*' -exec sed -Ei 's/('${releaseVersion//./\\.}')-SNAPSHOT/\1/g' {} \;
find -type f \( -name "MANIFEST.MF" -o -name "feature.xml" -o -name "category.xml" \) -not -path '*/target/*' -exec sed -Ei 's/('${releaseVersion//./\\.}')\.qualifier/\1/g' {} \;

git add .
git commit -m "Updated version for release"

# Build with the release version
mvn clean verify
git push

Now run the "Deploy P2 Repository to GitHub Pages" GitHub action to update the Eclipse update site. After that's succeeded, check the contents of the Eclipse update site. If it looks good, add the new version on the Eclipse Marketplace, here.

After that, do the tagging:

git tag -a "v${releaseVersion}" -m "Release"
git push --follow-tags

Now find the tag on the Github website, and publish a release from it (there should be a such option). You should attach site/target/freemarker.site-${releaseVersion}.zip to the release on GitHub.

Next, switch to the new development version:

find -type f -name "pom.xml" -not -path '*/target/*' -exec sed -Ei 's/'${releaseVersion//./\\.}'/'$nextVersion'-SNAPSHOT/g' {} \;
find -type f \( -name "MANIFEST.MF" -o -name "feature.xml" -o -name "category.xml" \) -not -path '*/target/*' -exec sed -Ei 's/'${releaseVersion//./\\.}'/'$nextVersion'.qualifier/g' {} \;

git add .
git commit -m "Updated version for development"
git push

Change log (version history)

1.5.307

Date of release: 2024-06-19

1.5.306

Date of release: 2021-07-10

1.5.305

Date of release: 2020-03-07

1.5.304

Date of release: 2019-09-01

1.5.303

Date of release: 2019-08-23