ddekany / jbosstools-freemarker

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

Use gh-pages as P2 repository #8

Closed glhez closed 3 years ago

glhez commented 3 years ago

Hello,

This mark an implementation of my suggestion in https://github.com/ddekany/jbosstools-freemarker/issues/7#issuecomment-842878105

Sadly, due to some problem with tycho and github actions - namely, the fact it could not resolve a commit (Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:1.1.0:build-qualifier (default-build-qualifier) on project org.jboss.ide.eclipse.freemarker: Could not determine git commit timestamp: Missing commit 0f7b2af48fee792abc626ef6f575743240ecfb80 -> [Help 1]) I had to:

  1. Update parent project to more or less latest jboss.
  2. Use Java 11 instead of Java 8 - due to jboss parent
  3. I also upgraded freemarker to 2.3.31 instead of 2.3.30

The repository is available at https://glhez.github.io/jbosstools-freemarker/ or, when merged, https://ddekany.github.io/jbosstools-freemarker/ and Git Hub pages must be enabled.

The action is manual and will deploy on the root of the gh-pages. I think the action permits to customize it using target-folder : https://github.com/JamesIves/github-pages-deploy-action#optional-choices

Note: I did not have time to test if Java 11 break the editor, and I don't have at home an env with Freemarker template.

ddekany commented 3 years ago

Thanks a lot! I will check it out, eventually.

Raising the requirements when we don't actually need them is of course unfortunate, but of course even with that it's better than what we have at the moment. Will have to figure out what the lowest Eclipse version can be. I guess Java over 8 can also be problem at some big corp developer desktops (though 11 is required since Eclipse 4.17, 2020-09).

glhez commented 3 years ago

Yes. I've put the PR on hold because I want to test it on an actual Eclipse. I don't have a Freemarker template to test for regression (beside the test), but I do use it at work.

The action, on the other hand, is unrelated to all of that. You could probably use it as is, with Java 8 but you will have to investigate the commit problem:

glhez commented 3 years ago

As I feared, I've got strange problem in the editor. An error only mentioning some freemarker class: freemarker/template/utility/StringUtil

image

I'll try to investigate it first but I suppose some initialization error in the class for some random error.

glhez commented 3 years ago

Hello,

I dig more into the problem: I think this was related to my change to Freemarker 2.3.31 which was partial, and especially not the bundle. I also fixed a mised of Configuration(Version) which was always using the latest, hence issuing some error.

I also added a target platform, using 2021-06 as reference, however jboss reference 2019.03/06.

ddekany commented 3 years ago

Eclipse 2021-06 is very new. Did you try this with lower versions? How far can we go back?

glhez commented 3 years ago

I might have overlooked the error message:

Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/tycho/core/p2/P2RepositoryConnectorFactory has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I would say that Tycho wants Java 11, not that the plugin needs Java 11. I do remember the 2.3.0 being compiled with Java 11.

However, this is problematic with GitHub action because I don't know if you can have both a Java 8 and a Java 11 (I had the same problem with travis and maven toolchains : maven toolchain allows it, not the build system itself). On the other hand, the actual jboss parent use a version of jgit that fail with shallow clone which I believe GitHub Action uses: it tries to locate some commit and fail. I tried changing the build-qualifier to "default" but it did not change much.

An alternative would be a manual update to github page (1). Or try (sic) each version of jboss parent until one works with Java 8 + GitHub Actions.

And to clarify, the plugin should work with any Eclipse >= 2020.09 (first version using Java 11) due to Java 11 restrictions, but there is no tie to Eclipse 2021.06 in itself beside the Target Platform I added. A Oomph Setup could be also be done.

(1) I do think you should do that on the main repo, fix the update site for users who wants the plugin since bintray no longer work.

Automation can come after: you only need to copy content of {{site/target/repository}} to the gh-pages branches after building. You may use git worktree or clone the same repository switch to {{gh-pages}} branches.

You are not even forced to use this branch : {{https://raw.githubusercontent.com/d-akara/eclipse-updatesite/master/dakara.eclipse.updatesite/site.xml}} directly use master. But I think github pages are better for that.

I'll try to split the PR down to freemarker 2.3.31 with you remark, and update site automation.

ddekany commented 3 years ago

Closing this because you made an improved PR for the same.