]> source.dussan.org Git - aspectj.git/log
aspectj.git
3 years agoCompletely remove module ASM-renamed + references 53/head
Alexander Kriegisch [Sun, 16 May 2021 03:22:42 +0000 (10:22 +0700)]
Completely remove module ASM-renamed + references

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReplace use of ASM-renamed by original ASM
Alexander Kriegisch [Sun, 16 May 2021 03:17:12 +0000 (10:17 +0700)]
Replace use of ASM-renamed by original ASM

This involves replacing references in weaver application code as well as
a few tests.

In order to make AspectJ weaver + tools contain a relocated ASM version,
I added a Maven Shade relocation step after Maven Assembly created the
uber JARs. Relocation works for both binaries and sources and also
encompasses Class::forName calls like in class AsmDetector.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agouse the alternate maven settings by default
Andy Clement [Fri, 14 May 2021 21:50:11 +0000 (14:50 -0700)]
use the alternate maven settings by default

3 years agoMerge pull request #49 from kriegaex/migrate-to-aspectj-dev
Andy Clement [Fri, 14 May 2021 20:02:02 +0000 (13:02 -0700)]
Merge pull request #49 from kriegaex/migrate-to-aspectj-dev

Migrate deployment from GitHub Packages to aspectj.dev

3 years agoRemove jdiff
Andy Clement [Fri, 14 May 2021 15:16:29 +0000 (08:16 -0700)]
Remove jdiff

3 years agoMigrate deployment from GitHub Packages to aspectj.dev 49/head
Alexander Kriegisch [Sat, 8 May 2021 12:59:06 +0000 (19:59 +0700)]
Migrate deployment from GitHub Packages to aspectj.dev

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #48 from kriegaex/deploy-main-artifacts-only
Andy Clement [Mon, 10 May 2021 18:22:40 +0000 (11:22 -0700)]
Merge pull request #48 from kriegaex/deploy-main-artifacts-only

Only deploy main artifacts, default to no deployment for all others

3 years agoMerge pull request #46 from kriegaex/lib-auto-provisioning
Andy Clement [Mon, 10 May 2021 18:21:46 +0000 (11:21 -0700)]
Merge pull request #46 from kriegaex/lib-auto-provisioning

Provision libraries in `lib` automatically

3 years agoPrepare main artifacts to be deployed via Maven, step 2 48/head
Alexander Kriegisch [Sat, 8 May 2021 12:53:14 +0000 (19:53 +0700)]
Prepare main artifacts to be deployed via Maven, step 2

This change affects the following modules:
  - aspectjmatcher
  - aspectjrt
  - aspectjtools
  - aspectjweaver
  - installer
  - asm-renamed

Set maven.deploy.skip=false in parent POM, i.e. Maven Deploy by default
will *not deploy anything. Only in the modules above, we change the
value to 'true' in order to deploy those artifacts.

This setting works for both snapshot repositories (GitHub Packages, soon
to be migrated to aspectj.dev in a separate PR) and release
repositories, i.e. in the future also for Maven Central.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMove Enforcer Plugin to 'compile' phase in 'lib' 46/head
Alexander Kriegisch [Thu, 6 May 2021 22:23:14 +0000 (05:23 +0700)]
Move Enforcer Plugin to 'compile' phase in 'lib'

There is a strange effect in Maven builds: Depending on which profiles
are active when building the project - even seemingly unrelated ones
like 'create-docs' or 'clean-libs' - the execution order of plugins in
the 'process-resources' phase can vary. Specifically, Build Helper vs.
Enforcer in module 'lib', which both were in the same phase, can
sometimes be executed in lexical order, which I expected, or the other
way around, which makes the build fail if the existence of the marker
file is checked by Enforcer before Build Helper even had a chance to
create it. Probably, this is because Build Helper is defined inside a
profile and Enforcer outside of any.

Therefore, the safest way to ensure correct ordering of the two is to
place Enforcer in a later phase, in this case 'compile'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove 'name' tags in POMs
Alexander Kriegisch [Thu, 6 May 2021 04:54:37 +0000 (11:54 +0700)]
Improve 'name' tags in POMs

I tripped over not finding aspectjtools in my IntelliJ Maven view many
times, because it was listed as "AspectJ Compiler". So I renamed it to
"AspectJ Tools (Compiler)". Now it resembles more the artifact ID and
still retains the information that it is the artifact containing AJC.

For the 'lib' module I removed the 'name' tag again, because it is not
one of the main artifacts we publish. Now the POMs are more like Andy
might have intended them to be, using a human-readable 'name' only for
the main artifacts.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoBump download-maven-plugin 1.6.1 -> 1.6.3
Alexander Kriegisch [Wed, 5 May 2021 10:41:54 +0000 (17:41 +0700)]
Bump download-maven-plugin 1.6.1 -> 1.6.3

In the previous GitHub build, there were warnings in the log because of
failed downloads. Actually, the default is to fail the build, but that
did not happen. Let us try a more recent version, maybe it fixes an old
bug, even though in the diff between the versions I did not see anything
obvious here.

Anyway, I created an issue ticket:
https://github.com/maven-download-plugin/maven-download-plugin/issues/185

BTW, our build only failed later during the Maven Enforcer sanity check,
because several files from the check list were missing after a seemingly
successful provisioning. Actually, I am glad I added this "redundant"
double-checking step to the build, otherwise the build would not have
failed in the 'lib' module but much later in a hard to detect spot.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove obsolete separate GitHub build step for provisioning libraries
Alexander Kriegisch [Wed, 5 May 2021 09:41:56 +0000 (16:41 +0700)]
Remove obsolete separate GitHub build step for provisioning libraries

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoProvision libraries in 'lib' automatically
Alexander Kriegisch [Wed, 5 May 2021 09:21:53 +0000 (16:21 +0700)]
Provision libraries in 'lib' automatically

Upon special request by Andy Clement, I included 'lib' as a child module
in the parent POM again, making several modules which refer to
downloaded library files dependent the 'lib' module. I am not sure I
caught all of them, but I hope so.

Now after cloning the project and configuring the token for reading from
GitHub Packages (sorry!), you can just run a Maven build for the main
project and no longer need to fail the first build, read the Maven
Enforcer message and run 'cd lib && mvn compile' as a first step. This
convenience comes at the price of a more complex POM and two new
profiles:

  - Profile 'provision-libs' is auto-activated by the absence of a
    marker file, kicking off the library provisioning process and
    creating same marker file at the end, if successful. Therefore,
    during subsequent builds libraries will not be re-provisioned,
    because the marker file exists and Maven skips all download and
    (un)zip steps, which saves build time and bandwidth. Otherwise
    offline builds would not work either.

  - Profile 'clean-libs' needs to be activated manually, because by
    default 'mvn clean' will not erase provisioned libraries. In most
    cases, even after a clean a developer does not want to re-provision
    all libraries if they have not changed (e.g. new JDT Core build).
    But if you do wish too erase the libraries and the marker file, just
    call 'cd lib && mvn -P clean-libs clean'.

Please note: The Maven Enforcer build step, which additionally checks
for existence of other files, still exists and was moved from the parent
POM to 'libs'. No matter if provisioning was just done or skipped
because the main marker file exists, a quick heuristic check for that
list of files is done during each build, failing the build with a
comprehensive message if an inconsistency was found. The error message
says which files are missing and tells the user:

  "There is an inconsistency in module subdirectory 'lib'. Please run
  'mvn --projects lib -P clean-libs clean compile'. This should take
  care of cleaning and freshly downloading all necessary libraries to
  that directory, where some tests expect them to be."

This should cover the topic.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #44 from kriegaex/run-all-junit-tests-dependencies
Andy Clement [Wed, 28 Apr 2021 20:08:08 +0000 (13:08 -0700)]
Merge pull request #44 from kriegaex/run-all-junit-tests-dependencies

Fix missing dependencies in module 'run-all-junit-tests'

3 years agoFix missing dependencies in module 'run-all-junit-tests' 44/head
Alexander Kriegisch [Wed, 28 Apr 2021 06:54:33 +0000 (13:54 +0700)]
Fix missing dependencies in module 'run-all-junit-tests'

Some runtime dependencies are reported as unused in Maven Dependency
Plugin goal 'dependency:analyze', but actually they are needed. I
noticed by chance when running RunTheseBeforeYouCommitTests in IntelliJ
IDEA for the first time after a while and dependency modules could not
find classes.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMerge pull request #41 from kriegaex/libs-refactoring
Andy Clement [Mon, 26 Apr 2021 04:43:22 +0000 (21:43 -0700)]
Merge pull request #41 from kriegaex/libs-refactoring

Libs refactoring (remove libs from Git SCM)

3 years agoPrepare main artifacts to be deployed via Maven, step 1 41/head
Alexander Kriegisch [Mon, 26 Apr 2021 03:02:15 +0000 (10:02 +0700)]
Prepare main artifacts to be deployed via Maven, step 1

This change affects the following modules:
  - aspectjmatcher
  - aspectjrt
  - aspectjtools
  - aspectjweaver
  - installer

They have in common that they all use Maven Assembly Plugin in order to
create some kind of uber JARs with constituent modules and/or libraries.
Except for the installer, they are all available on Maven Central today,
but I think it would not hurt to deploy the installer to there, too.

Changes made:
  - Use Flatten Maven Plugin in order to create simple POMs with only
    basic information and - most importantly - without dependencies.
  - The new dependency-reduced POM (DRP) or "flattened POM" gets
    attached to the build, i.e. it will be installed and deployed as a
    replacement of the original POM.
  - Attaching the DRP only works for 'jar' type modules, which is why I
    changed the packaging type for each module from 'pom' to 'jar'.
  - Deactivate generation of the default JAR for each module. This is
    necessary now, since we have the 'jar' packaging type.
  - Make sure that assembly descriptors using 'dependencySet' entries
    have set option 'useProjectArtifact=false' in order to avoid
    warnings about the non-existing main artifact.

TODO:
  - Explore option to migrate from Maven Assembly to Maven Shade,
    because it does not need descriptor files, can also generate source
    JARs and can automatically create and attach a DRP which is less
    fragmentary than the one created by Flatten Maven, basically the
    original JAR minus the dependencies.
  - If in the future we want to make sure to only deploy the modules
    listed above, e.g. to Maven Central, if simply calling 'mvn deploy'
    for the whole project, we could use 'maven.deploy.skip=true' in the
    parent POM and override it by 'maven.deploy.skip=false' just in the
    few modules which need to be deployed. See also:
    https://stackoverflow.com/a/29574812/1082681
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove build/scripts/*
Alexander Kriegisch [Fri, 16 Apr 2021 17:48:47 +0000 (00:48 +0700)]
Remove build/scripts/*

These scripts look pretty antique and obsolete.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix: make sure that source assemblies are attached to build
Alexander Kriegisch [Fri, 16 Apr 2021 08:30:36 +0000 (15:30 +0700)]
Fix: make sure that source assemblies are attached to build

Previously I renamed the source assemblies from the uniform name
'sources' to something more individual like 'aspectjtools-sources', not
realising that the magic name 'sources' in combination with the default
configuration value 'appendAssemblyId=true' results in an artifact
classifier equal to the assembly ID, i.e. 'sources', which is exactly
what we need here, but not quite obvious. Therefore, I documented it
with comments in both the assemblies and the POMs.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove some cruft from test classes Ajc, AjcTestCase, AntSpec
Alexander Kriegisch [Fri, 16 Apr 2021 06:52:07 +0000 (13:52 +0700)]
Remove some cruft from test classes Ajc, AjcTestCase, AntSpec

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove managing obsolete folder lib/asm
Alexander Kriegisch [Fri, 16 Apr 2021 05:22:46 +0000 (12:22 +0700)]
Remove managing obsolete folder lib/asm

The new string AjcTestCase.CLASSPATH_ASM_RENAMED dynamically determines
the 'asm-renamed' location from the classpath, system property
'java.class.path'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUse dependencies instead of copies under 'lib' for assemblies
Alexander Kriegisch [Fri, 16 Apr 2021 05:14:31 +0000 (12:14 +0700)]
Use dependencies instead of copies under 'lib' for assemblies

This is one step to get rid of org.aspectj:org.eclipse.jdt.core and
org.aspectj:asm-renamed in the 'lib' directory.

AspectJ tools + weaver uber JAR builds now use dependencies in the POM
in order to deal with creating binary + source assemblies. They no
longer rely on manually updated copies under 'lib'. Details:
  - Binaries are copied via 'dependencySets' in the assembly descriptor.
  - Sources are unzipped via Maven Dependency Plugin before including
    them into the source uber JAR via assembly descriptor.
  - NEW: This also includes ASM-renamed sources which so far were
    ignored. It is a positive side-effect from the fact that for
    ASM-renamed Maven Shade automatically creates a source JAR.
  - Maven Ant Run is no longer used for unzipping binary + source JARs.
  - While working in parallel with JDT Core and AspectJ it is now much
    easier to produce up to date artifacts, e.g. for consumption by
    AJDT, because it does not matter anymore if we forget to run the
    build in module 'lib' in order to update the JDT Core copy.

Status quo:
  - Folder lib/asm is no longer used and will be removed in a subsequent
    commit.
  - Folder lib/jdtcore-aj is no longer used by the Maven build, but
    still referenced in a few UNIX shell scripts and Ant build files.
    TODO: Find out if those are still actively used. If yes, refactor
    them to look for the file in the local Mavven repository. Otherwise,
    delete the referencing files and also lib/jdtcore-aj.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoManage version version maven-assembly-plugin:3.1.1
Alexander Kriegisch [Fri, 16 Apr 2021 03:26:45 +0000 (10:26 +0700)]
Manage version version maven-assembly-plugin:3.1.1

No more manual version setting everywhere.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove redundant 'name' and 'packaging' tags from POMs
Alexander Kriegisch [Thu, 15 Apr 2021 11:52:14 +0000 (18:52 +0700)]
Remove redundant 'name' and 'packaging' tags from POMs

If 'name' is identical to 'artifactId' and 'packaging' has the default
value 'jar', we can just remove those tags from the POM.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove remaining usage message duplication between ECJ and AJC
Alexander Kriegisch [Tue, 13 Apr 2021 17:40:34 +0000 (00:40 +0700)]
Remove remaining usage message duplication between ECJ and AJC

The resource key 'misc.usage' is completely gone from
.../jdt/internal/compiler/batch/messages_aspectj.properties. Instead,
JDT Core was adjusted in such a way as to patch the new resource key
'misc.usage.aspectj' into the upstream 'misc.usage' in the right place.

Now finally the properties file is as lean as I envisioned it to be,
without any loss of information and without the need of future manual
synchronisation of duplicate texts for every release.

At the same time, usage text detection in AjdtCommand::inferKind was
improved and also adjusted to the new situation.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd lib/docbook to Maven Clean
Alexander Kriegisch [Mon, 12 Apr 2021 19:12:57 +0000 (02:12 +0700)]
Add lib/docbook to Maven Clean

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUpgrade JUnit BoM to 5.7.1
Alexander Kriegisch [Mon, 12 Apr 2021 07:03:35 +0000 (14:03 +0700)]
Upgrade JUnit BoM to 5.7.1

We are not using Jupiter yet, but this is nice to have for the future.
Thanks to @larsgrefer for his initiative to prepare AspectJ for
JUnit Jupiter and for his other PR which also contains the same change
in the parent POM. :-)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix undetected runtime dependency usage problem from previous commit
Alexander Kriegisch [Mon, 12 Apr 2021 06:52:28 +0000 (13:52 +0700)]
Fix undetected runtime dependency usage problem from previous commit

In module 'tests', our tests need Ant launcher. Hence, dependency
ant:ant-launcher was re-added to the POM (with test scope this time)
and Maven Dependency plugin configured to regard it as a used
dependency and not falsely report it as unused.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix undetected runtime dependency usage problem from previous commit
Alexander Kriegisch [Mon, 12 Apr 2021 06:39:56 +0000 (13:39 +0700)]
Fix undetected runtime dependency usage problem from previous commit

In module 'ajdoc', our tests need tools.jar when running on JDK 8 in
order to dynamically compile during runtime. Hence, dependency
com.github.olivergondza:maven-jdk-tools-wrapper was re-added to the POM
(with test scope this time) and Maven Dependency plugin configured to
regard it as a used dependency and not falsely report it as unused.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoClean up Maven dependencies using 'dependency:analyze' goal
Alexander Kriegisch [Mon, 12 Apr 2021 06:16:29 +0000 (13:16 +0700)]
Clean up Maven dependencies using 'dependency:analyze' goal

Notably, this change involves a partial revert of @4a5660b3, because we
are not using JUnit Jupiter yet but still JUnit 4 tests. See discussion
under commit at https://github.com/eclipse/org.aspectj/commit/4a5660b3.

Many other warnings - concerning both used undeclared and unused
declared dependencies - were eliminated by adding or removing the
corresponding dependencies from the POMs. Furthermore, I tried to make
sure that some clearly test-scoped dependencies are now actually
declared as such, so as to avoid unwanted transitivity bleeding into
compile scope and maybe unwanted classes ending up in uber JARs via
Maven Shade or Maven Assembly.

TODO: I am not so sure why modules other than 'run-all-unit-tests' would
depend on test JARs. I hope I broke nothing essential there. As of
today, the other modules where I found '<type>test-jar</type>'
dependencies are:
  - ajde
  - testing
  - testing-drivers
  - tests
  - weaver

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix image formatting glitch in docs/devGuideDB/ajbrowser.xml
Alexander Kriegisch [Sat, 10 Apr 2021 13:34:20 +0000 (20:34 +0700)]
Fix image formatting glitch in docs/devGuideDB/ajbrowser.xml

An image which should be in its own paragraph was shown inline with the
text, somewhere to the right in the middle of a text paragraph. I
noticed while visually checking if docs generation still works as
expected after the last few commits, so I quickly fixed it.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoDelete all remaining docbook contents, download them instead
Alexander Kriegisch [Sat, 10 Apr 2021 13:30:57 +0000 (20:30 +0700)]
Delete all remaining docbook contents, download them instead

Actually, only fop:fop:0.20.5 and batik:batik-1.5-fop:0.20-5 are really
used in addition to lib/saxon/saxon.jar (saxon:saxon:6.5.3). So the rest
does not need to be replaced and can just be wiped.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoDelete docbook XSL + DTD directories from libs, download instead
Alexander Kriegisch [Sat, 10 Apr 2021 12:55:01 +0000 (19:55 +0700)]
Delete docbook XSL + DTD directories from libs, download instead

It was kind of difficult to identify and find the vintage versions used
in AspectJ in download archives, but finally I managed to. Docs
generation looks good visually, tests to be run on GitHub CI.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove indentation from <programlisting> blocks in docs
Alexander Kriegisch [Sat, 10 Apr 2021 12:19:39 +0000 (19:19 +0700)]
Remove indentation from <programlisting> blocks in docs

Many dozens (hundreds?) of documentation code blocks were indented to
match the surrounding XML or just arbitrarily. The thing is: Inside
<programlisting> tags, similar to <pre> tags, line feeds and leading
whitespace are being preserved, which looked very awkward in the HTML
documentation. While a few files were mostly correct in this respect,
which shows that it was meant to be like that, many others were not.
This was tedious, stupid work to fix, but it had to be done.

Please note that the documentation was in no way updated content-wise.
This is also overdue, but not my focus here.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd comments about wrong classpath entries to docs/build.xml
Alexander Kriegisch [Sat, 10 Apr 2021 09:42:09 +0000 (16:42 +0700)]
Add comments about wrong classpath entries to docs/build.xml

Of 6 classpath entries for Ant taskdef "fop", only 2 are actually
correct. That might mean that the others are not necessary, because docs
generation works correctly anyway.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix faulty path in docs/progGuideDB/progguide.html.xsl
Alexander Kriegisch [Sat, 10 Apr 2021 09:38:18 +0000 (16:38 +0700)]
Fix faulty path in docs/progGuideDB/progguide.html.xsl

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoCompletely delete Jython in lib/jython
Alexander Kriegisch [Sat, 10 Apr 2021 06:57:58 +0000 (13:57 +0700)]
Completely delete Jython in lib/jython

AFAIK, Jython is not used anywhere in out tests, also not in combination
with Ant. So I have decided to delete it altogether. If the build
passes, we should be fine and be able to travel more lightly in the
future.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoSwitch from 'libx' to 'lib', delete all obsolete binaries
Alexander Kriegisch [Sat, 10 Apr 2021 06:03:30 +0000 (13:03 +0700)]
Switch from 'libx' to 'lib', delete all obsolete binaries

Because 'cd lib && mvn compile' can now download and (un)zip many
previously SCM-committed third-party dependencies, the following 'lib'
subdirectories have been deleted:
 - ant
 - asm
 - commons
 - jarjar
 - junit
 - regexp
 - saxon
This one is new (but not stored in SCM):
 - jdtcore-aj

For each of them, there now is a .gitignore entry, so as to prevent
developers from accidentally committing the downloaded binaries again.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoClean up remaining references to system-scoped dependencies
Alexander Kriegisch [Sat, 10 Apr 2021 05:45:22 +0000 (12:45 +0700)]
Clean up remaining references to system-scoped dependencies

Now there is no system-scoped dependency left anymore in the Maven
build, i.e. the corresponding warnings are gone and we can focus on the
actual build log.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove JRockit LTW support, particularly JRockitAgent
Alexander Kriegisch [Sat, 10 Apr 2021 05:32:04 +0000 (12:32 +0700)]
Remove JRockit LTW support, particularly JRockitAgent

In two places, the documentation now contains this text:

"Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer
part of AspectJ. JRockit JDK never supported Java versions higher than
1.6. Several JRockit JVM features are now part of HotSpot and tools like
Mission Control available for OpenJDK and Oracle JDK."

The decision to drop JRockit support was made during a discussion
between Alexander Kriegisch and Andy Clement:

Andy Clement wrote on 26 Mar 2021:

> Yes I think so.
>
>
> Alexander Kriegisch wrote on 26 Mar 2021:
>
>> https://en.wikipedia.org/wiki/JRockit
>>
>> Can we get rid of that? AspectJ requires Java 8, JRockit never
>> supported more than Java 6.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMove lib/ext/jrockit to just lib/jrockit
Alexander Kriegisch [Sat, 10 Apr 2021 04:44:47 +0000 (11:44 +0700)]
Move lib/ext/jrockit to just lib/jrockit

It was the only subdirectory under lib/ext anyway and somehow always
irritating and difficult to find when just using a directory browser in
the IDE.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReplace JDiff by regular Maven dependency from GitHub Packages
Alexander Kriegisch [Sat, 10 Apr 2021 04:27:33 +0000 (11:27 +0700)]
Replace JDiff by regular Maven dependency from GitHub Packages

One less SCM-committed binary, one less system-scoped dependency.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoDownload correct JDiff binaries and sources to 'libx'
Alexander Kriegisch [Sat, 10 Apr 2021 03:27:26 +0000 (10:27 +0700)]
Download correct JDiff binaries and sources to 'libx'

This enables us to replace the original file from SCM. There is even an
improvement, like in other packages before: We create separate binary
and source archives, copying files from the compound download archive.
This way the library should be easy to use in an IDE.

TODO: This still does not get rid of the system path. Maybe it is better
to upload source and binary JARs to GitHub Packages.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUse special Maven settings with access token to GitHub Packages
Alexander Kriegisch [Fri, 9 Apr 2021 13:04:24 +0000 (20:04 +0700)]
Use special Maven settings with access token to GitHub Packages

The access token is for the 'kriegaex' account. Can be adjusted or
extended in order to support other Package registries, too. for now, I
just want to see it this solves the authentication error problems during
GitHub CI builds.

The new file .mvn/settings-read-github-packages.xml contains additional
information and links to online sources, explaining why this is
necessary.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUse additional Maven Clean execution in 'libx'
Alexander Kriegisch [Fri, 9 Apr 2021 11:18:11 +0000 (18:18 +0700)]
Use additional Maven Clean execution in 'libx'

Before, the Maven Clean configuration overrode the one from the parent
POM. Now it leaves it intact, adding a separate module-specific
execution to delete the downloads and libraries.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake sure to clean up temp-dirs in 'weaver' module
Alexander Kriegisch [Fri, 9 Apr 2021 11:16:28 +0000 (18:16 +0700)]
Make sure to clean up temp-dirs in 'weaver' module

Maven Clean now deletes '' directories if it finds any. Furthermore,
AsynchronousFileCacheBackingTestSupport now not just deletes directory
contents but also removes the empty corresponding directories
afterwards.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoCI test still failing, try 'mvn -U' in order to refresh
Alexander Kriegisch [Fri, 9 Apr 2021 08:18:44 +0000 (15:18 +0700)]
CI test still failing, try 'mvn -U' in order to refresh

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUse flattenMode=defaults for 'asm-renamed'
Alexander Kriegisch [Fri, 9 Apr 2021 08:06:08 +0000 (15:06 +0700)]
Use flattenMode=defaults for 'asm-renamed'

On GitHub CI, there is a very strange error while downloading the POM,
which does not occur locally. Maybe this is due to the usage of
inline XML tags inside a CDATA section in the 'description' tag text.
The default mode removes the description.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoCentrally manage ASM version in parent POM
Alexander Kriegisch [Fri, 9 Apr 2021 08:03:28 +0000 (15:03 +0700)]
Centrally manage ASM version in parent POM

There is a warning because 'asm-renamed' uses
<version>${asm.version}</version> in its artifact descriptor instead of
a fixed version. but as long as Maven still permits it, let us use it
this way. Flatten Maven plugin replaces it by a resolved number anyway
for the dependency-reduced POM.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove duplicate Maven Clean declaration in parent POM
Alexander Kriegisch [Fri, 9 Apr 2021 07:43:17 +0000 (14:43 +0700)]
Remove duplicate Maven Clean declaration in parent POM

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix missing ASM version in 'aspectj-renamed' POM
Alexander Kriegisch [Fri, 9 Apr 2021 07:42:52 +0000 (14:42 +0700)]
Fix missing ASM version in 'aspectj-renamed' POM

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoPOM cosmetics, e.g. plugin version management
Alexander Kriegisch [Fri, 9 Apr 2021 07:07:09 +0000 (14:07 +0700)]
POM cosmetics, e.g. plugin version management

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove 2 tests do delete temporary files
Alexander Kriegisch [Fri, 9 Apr 2021 07:05:00 +0000 (14:05 +0700)]
Improve 2 tests do delete temporary files

There were some problems in file handling: One file in was not deleted
in case an exception was thrown during the test. Another case was a
JarFile which was not closed before deletion, which might work on Linux,
but not on Windows where the open file is still locked after usage.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoModule 'asm-renamed' now deploys to GitHub Packages
Alexander Kriegisch [Fri, 9 Apr 2021 07:00:57 +0000 (14:00 +0700)]
Module 'asm-renamed' now deploys to GitHub Packages

This means that instead of a system-scoped dependency we now have a
regular one.

The 'libx' module also downloads binary and source JARs redundantly into
the libraries directory in order to be found there by other scripts and
tests.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReplace JDT Core system dependency by deployed one
Alexander Kriegisch [Fri, 9 Apr 2021 06:55:33 +0000 (13:55 +0700)]
Replace JDT Core system dependency by deployed one

Get rid of system paths. Instead, rely on JDT Core Shadows to deploy
both binary and source JARs to GitHub Packages. The former module
directory was deleted completely. Instead, the JARs are redundantly
copied into 'libs/jdtcore-aj' in order to be found there by tests and
other Ant scripts.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoBuild libs without additional profiles, add Enforcer rule
Alexander Kriegisch [Fri, 9 Apr 2021 04:59:05 +0000 (11:59 +0700)]
Build libs without additional profiles, add Enforcer rule

Because 'libx' no longer is a submodule of the AspectJ parent POM, it
will not be built automatically each time an AspectJ build runs.
Therefore, is is no longer necessary to shield the zip/unzip steps from
repetitive execution by profiles with auto-activation based on the
(non-)existence of files. An AspectJ developer knows when to build the
module, she does it manually anyway.

A new Enforcer rule makes sure to warn the developer if some files it
expects to exist in the libs folder are not actually present.

Now we also have a Maven Clean rule which wipes away all downloaded and
(un-)zipped files.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoEnable CI build to be run manually and add download libs step
Alexander Kriegisch [Fri, 9 Apr 2021 04:42:01 +0000 (11:42 +0700)]
Enable CI build to be run manually and add download libs step

Via 'workflow_dispatch' users with the necessary access rights can now
run the GitHub Actions workflow from the web UI.

Still in testing stage in redundant module 'libx', prepare for the
future situation that currently committed binaries in 'lib' shall be
replaced by downloaded ones.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoGet rid of some Maven warnings concerning plugins + dependencies
Alexander Kriegisch [Tue, 30 Mar 2021 02:48:05 +0000 (09:48 +0700)]
Get rid of some Maven warnings concerning plugins + dependencies

Duplicate dependencies, missing or mismatching versions

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove ASM 2.0 dependency from AtAjLTWTests::testLTWUnweavable
Alexander Kriegisch [Mon, 29 Mar 2021 09:50:44 +0000 (16:50 +0700)]
Remove ASM 2.0 dependency from AtAjLTWTests::testLTWUnweavable

The test class UnweavableTest used ASM 2.0 API. I upgraded in two ways:
  1. Now the ASM 9.1 API is used. Probably works with much older
     versions too (just not as old as 2.0), as long as the method and
     constructor signatures are the same).
  2. The class now uses the AspectJ version of ASM (i.e. package names
     aj.org.objectweb.asm.*) and therefore can just use ASM as it is on
     the classpath for module 'tests' already. There is no more need to
     manually add '<pathelement path="${aj.root}/lib/asm/asm-2.0.jar"/>'
     to the Ant build script for that test.

Consequently, asm-2.0.jar can be eliminated from Git SCM completely,
because it was only used in this one test.

BTW, I also removed some deprecated API and other types of warnings in
UnweavableTest.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReplace system-scoped dependency on commons by granular dependencies
Alexander Kriegisch [Mon, 29 Mar 2021 06:51:20 +0000 (13:51 +0700)]
Replace system-scoped dependency on commons by granular dependencies

There are only two direct dependencies used in AspectJ code:
  - Commons Digester (module 'testing')
  - Commons Logging (module 'org.aspectj.matcher')

I declared those two and experimentally removed all the other
system-scoped dependencies, as it should be. Let's see if the build
works with transitive dependencies.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove JDiff sources + binaries accidentally committed in @c89830fe
Alexander Kriegisch [Mon, 29 Mar 2021 05:55:49 +0000 (12:55 +0700)]
Remove JDiff sources + binaries accidentally committed in @c89830fe

The deleted files are just the unpacked + content of
lib/jdiff/jdiff.jar.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRecreate lib/commons from Apache Commons downloads
Alexander Kriegisch [Mon, 29 Mar 2021 05:45:27 +0000 (12:45 +0700)]
Recreate lib/commons from Apache Commons downloads

Project archeology, binary and source code comparisons of contents in
lib/commons/commons.jar and lib/commons/commons-src.zip yielded the
following results:
  - All binaries are available on Maven Central in 4 different legacy
    Apache Commons dependencies:
      * commons-beanutils:commons-beanutils:1.4
      * commons-collections:commons-collections:2.0
      * commons-digester:commons-digester:1.3
      * commons-logging:commons-logging:1.0.1
  - Those Maven Central binaries are not accompanied by source JARs,
    i.e. in order to recreate lib/commons/commons-src.zip we have to
    download source archives from the corresponding Git tags. All
    projects are available on GitHub, so it is possible to download them
    using Maven Download Plugin.
  - Both the compound binaries and compound sources archives currently
    checked in in AspectJ can be recreated using TrueZIP Maven Plugin.
    This is rather tedious and involves additional Maven profiles in
    order not to generate the compound archives during every build, but
    fully implemented now.

Unfortunately, all of the above does not make the system-scoped
dependency on commons.jar obsolete. In order to achieve that, we either
have to publish the compound files on Maven Central or GitHub Packages,
or we find out which AspectJ modules use classes from which of the 4
individual Apache Commons packages and replace the compound system
dependency by the relevant single dependencies. Probably I am going to
try that in a next step.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReplace Ant and Xerces system-scopes libraries by normal dependencies
Alexander Kriegisch [Mon, 29 Mar 2021 02:57:56 +0000 (09:57 +0700)]
Replace Ant and Xerces system-scopes libraries by normal dependencies

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRecreate lib/ant from Apache source/binary downloads
Alexander Kriegisch [Mon, 29 Mar 2021 01:45:01 +0000 (08:45 +0700)]
Recreate lib/ant from Apache source/binary downloads

- Download Ant 1.6.3 binaries and sources ZIPs from Apache releases
  download server
- Verify expected SHA-1 checksums
- Unpack binary distribution
- Repack main sources into source package as it is checked in now
- Redundantly add JUnit JAR in order to 100% replicate existing
  directory layout
- Move downloads from 'validate' phase to 'generate-resources'
- Unpack/repack phase is 'process-resources'
- Make sure that download, unpack, repack only occur if necessary
  instead of overwriting existing artifacts during each build

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd POM to download libs (WIP) which previously were committed to SCM
Alexander Kriegisch [Wed, 17 Mar 2021 01:12:46 +0000 (08:12 +0700)]
Add POM to download libs (WIP) which previously were committed to SCM

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoBump maven-antrun-plugin from 1.6 to 3.0.0 39/head
Alexander Kriegisch [Mon, 29 Mar 2021 03:07:51 +0000 (10:07 +0700)]
Bump maven-antrun-plugin from 1.6 to 3.0.0

This is not strictly necessary, but probably does not hurt either. While
upgrading, '<tasks>' tags have been renamed to the new standard
'<target>'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoInstall module org.eclipse.jdt.core in 'install' phase, not 'verify'
Alexander Kriegisch [Sun, 28 Mar 2021 05:45:48 +0000 (12:45 +0700)]
Install module org.eclipse.jdt.core in 'install' phase, not 'verify'

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoReformat org.eclipse.jdt.core POM
Alexander Kriegisch [Sun, 28 Mar 2021 02:07:48 +0000 (09:07 +0700)]
Reformat org.eclipse.jdt.core POM

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUnzip dependencies in phase 'prepare-package' before building assemblies
Alexander Kriegisch [Sun, 28 Mar 2021 02:02:08 +0000 (09:02 +0700)]
Unzip dependencies in phase 'prepare-package' before building assemblies

Before it was phase 'validate', which was way too early and somewhat
annoying and time-consuming when during development we just call
validate in order to check if the POMs are valid, as the name implies.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix JRockitAgentTest.testJrockitRecursionProtection for JVM 9+
Alexander Kriegisch [Sat, 27 Mar 2021 02:04:23 +0000 (09:04 +0700)]
Fix JRockitAgentTest.testJrockitRecursionProtection for JVM 9+

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd developer info + sample config about how to work with a RAM disk
Alexander Kriegisch [Thu, 25 Mar 2021 03:31:33 +0000 (10:31 +0700)]
Add developer info + sample config about how to work with a RAM disk

There are two files:
  - docs/developer/ram-disk/maven.config
  - docs/developer/ram-disk/settings-ramdisk.xml

The latter contains info about how to set up a development environment
inside a RAM disk. Both files are to be copied to the project's '.mvn'
folder in the root directory and adjusted according to the description.

Just in case, .gitignore ignores the files if they exist in '.mvn', so
they are not being staged and committed accidentally.

An additional screenshot shows how to configure the Windows Recycle Bin
to immediately delete files in order too save space on the RAM disk.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoTry to avoid 'HeadlessException: No X11 DISPLAY' on GitHub Actions
Alexander Kriegisch [Wed, 24 Mar 2021 07:46:23 +0000 (14:46 +0700)]
Try to avoid 'HeadlessException: No X11 DISPLAY' on GitHub Actions

We have 84 times this kind of exceptions in 'ajde' tests in our build
logs on GitHub, even though the tests seem to pass:

  HeadlessException: No X11 DISPLAY variable was set,
  but this program performed an operation which requires it.

I found this discussion:
https://github.com/juliangruber/browser-run/issues/147

And then this GitHub Action:
https://github.com/marketplace/actions/gabrielbb-xvfb-action

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake all tests run on Java 16 via '-add-opens' JVM option java16-add-opens
Alexander Kriegisch [Tue, 23 Mar 2021 09:59:17 +0000 (16:59 +0700)]
Make all tests run on Java 16 via '-add-opens' JVM option

Due to JEP 260 (Encapsulate Most Internal APIs), aspect weaving on
Java 16 now requires '--add-opens java.base/java.lang=ALL-UNNAMED' on
the command line. Otherwise there will be illegal access exceptions for
some internal API calls AspectJ needs, most prominently when trying to
define classes in other packages or modules.

This had to be done on several levels:

  - Maven Surefire: running tests in a JVM directly forked by Surefire.
    In order to make this backwards compatible, I added two profiles
    with JDK-level-dependent auto-activation, one 8-15 and one 16+. In
    the latter a property containing the JVM parameter is defined, in
    the former it is empty, i.e. the JVM is started without the
    parameter. In Java 8 the parameter did not even exist, in Java 9+ we
    could use it, but we need to test how users use AspectJ.

  - RunSpec: Whenever an XML test is declared to use '<run>', we need to
    determine the current JVM version and again dynamically add the
    parameter when forking the target JVM.

  - AntSpec: Whenever an XML test is declared to use '<ant>', we need to
    determine the current JVM version dynamically add two properties
    usable from within Ant scripts: 'aj.addOpensKey' and
    'aj.addOpensValue'. Unfortunately, Ant needs to use two '<argLine>'
    parameters, because the two parts of the option are separated by a
    space character.

  - Ant scripts: When triggered by an AntSpec, each Ant target using LTW
    needs to manually set
      <jvmarg value="${aj.addOpensKey}"/>
      <jvmarg value="${aj.addOpensValue}"/>
    for each '<java>' task. It was quite tedious to find all(?) of them.

TODO: In the AspectJ 1.9.7 release notes we need to document that this
parameter is now needed for LTW.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix AtAjLTWTests::testLTWDumpProxy for Java 16
Alexander Kriegisch [Tue, 23 Mar 2021 05:55:48 +0000 (12:55 +0700)]
Fix AtAjLTWTests::testLTWDumpProxy for Java 16

Before Java 16, JDK proxies were given a virtual package name of
'com.sun.proxy'. Now the packages are numbered 'jdk.proxy[n]', i.e.
'jdk.proxy1', 'jdk.proxy2' etc. This makes the package-name-derived path
name here less predictable. In our simple runtime scenario, we can be
pretty sure than the counter starts at 1 because it is the first and
only proxy we create.

TODO: A better solution would be a recursive filtered search via
Files.walk, ideally added as a recursive search option for
CountingFilenameFilter.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoDeactivate test run in 'run-all-unit-tests' module by default
Alexander Kriegisch [Mon, 22 Mar 2021 19:22:08 +0000 (02:22 +0700)]
Deactivate test run in 'run-all-unit-tests' module by default

There is a new Maven profile 'repeat-all-unit-tests', and the name
already implies what a comment in the Maven module explains like this:
ATTENTION: This profile is inactive by default, because when active and
running a full reactor build, it makes almost all tests run 2x, doubling
the build time without any added value. This Maven module only exists
for convenience: As a developer, your IDE can detect and run
'RunTheseBeforeYouCommitTests'. That way, you do not have to use Maven
and get the test results reported within the IDE's JUnit user interface.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRevert "Remove module 'run-all-junit-tests' from root POM -> speed up the build"
Alexander Kriegisch [Mon, 22 Mar 2021 18:25:22 +0000 (01:25 +0700)]
Revert "Remove module 'run-all-junit-tests' from root POM -> speed up the build"

This reverts commit a1867b05ba6443d32abc4049c26b92fc226d6f78.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd link to JDK-8263924 bug ticket to POMs using maven-assembly-plugin
Alexander Kriegisch [Mon, 22 Mar 2021 07:41:58 +0000 (14:41 +0700)]
Add link to JDK-8263924 bug ticket to POMs using maven-assembly-plugin

This is a follow-up on commit @0b182d60. I have just received
confirmation from Oracle that my issue was accepted:

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8263924
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 16 Linux matcher variant to HtmlDecorator
Alexander Kriegisch [Sun, 21 Mar 2021 14:45:34 +0000 (21:45 +0700)]
Add Java 16 Linux matcher variant to HtmlDecorator

The Java 16 Javadoc generator has changed the HTML structure once again
even compared to Java 15. I adjusted the matching in HtmlDecorator and
also fixed CoverageTestCase. Most methods there I just made to work
quickly, but method 'testInnerAspect()' I actually refactored. Some
other methods could (probably should) be restructured in a similar
fashion, but for now I just wanted to understand what the test does and
see how much work it would be to refactor it. But finally, I just want
to get the GitHub CI build running on Java 16.

TODO: I did not check if the decorated HTML actually looks OK and am
unsure if the tests cover that sufficiently, I never reviewed the tests.
It would also be better to do regex matches instead of looking for
variants of fixed strings or maybe even to operate on a DOM. But I am
not in a mood to refactor that tonight.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd diagnostic output to HtmlDecorator if AJ-Doc generation fails
Alexander Kriegisch [Sun, 21 Mar 2021 13:58:20 +0000 (20:58 +0700)]
Add diagnostic output to HtmlDecorator if AJ-Doc generation fails

HtmlDecorator.decorateHTMLFile is where after Java version upgrades
(i.e. also new Javadoc generator version) usually tests fail for the
first time during builds because strings no longer match as expected.

There now is this log message on stdOut: "Something unexpected went
wrong in HtmlDecorator. Here is the full file causing the problem:"
After that, a full HTML page is logged. I hope this helps me identify
the new error on GitHub Linux Java 16, because the same test works on
Windows and I have no idea how to remote-debug a GitHub CI build.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoMake BCEL classpath utility recognise Java 16-19, fixing many tests
Alexander Kriegisch [Sun, 21 Mar 2021 13:08:15 +0000 (20:08 +0700)]
Make BCEL classpath utility recognise Java 16-19, fixing many tests

This is a follow-up commit on @07af5d41:
Inside org.aspectj.apache.bcel.util.ClassPath.getClassPath(), some JVM
version matching occurs which previously did not include Java 16 (I also
added 17-19 to the regex matcher). This fixes test errors like:

java.lang.ClassCastException:
  class org.aspectj.weaver.MissingResolvedTypeWithKnownSignature
  cannot be cast to class
  org.aspectj.weaver.ReferenceType
  (org.aspectj.weaver.MissingResolvedTypeWithKnownSignature and
  org.aspectj.weaver.ReferenceType are in unnamed module
  of loader 'app')

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix AjcTaskTest regarding Ajc output
Alexander Kriegisch [Sun, 21 Mar 2021 12:57:55 +0000 (19:57 +0700)]
Fix AjcTaskTest regarding Ajc output

Another follow-up commit on @31b2d60b

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix OutjarTest regarding Ajc output (usage messages etc.)
Alexander Kriegisch [Sun, 21 Mar 2021 12:21:15 +0000 (19:21 +0700)]
Fix OutjarTest regarding Ajc output (usage messages etc.)

After Ajc usage text output is filtered into its own category
IMessage.USAGE now - see commit @31b2d60b - some tests in module
'org.aspectj.ajdt.core' were failing. I fixed and also improved them a
bit in @e4a2a5a5, but forgot to commit this one.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoSet explicit en_US locale for build timestamps in Build Helper Maven
Alexander Kriegisch [Sun, 21 Mar 2021 10:42:34 +0000 (17:42 +0700)]
Set explicit en_US locale for build timestamps in Build Helper Maven

There were warnings that builds were dependent on the system local
(de_DE in my case). In patterns like "EEEE MMM d, yyyy", parts like day
of week or month names would change otherwise.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix some deprecated Java and JUnit warnings by using newer API calls
Alexander Kriegisch [Sun, 21 Mar 2021 10:34:09 +0000 (17:34 +0700)]
Fix some deprecated Java and JUnit warnings by using newer API calls

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix + improve some tests regarding Ajc output (usage messages etc.)
Alexander Kriegisch [Sun, 21 Mar 2021 10:27:49 +0000 (17:27 +0700)]
Fix + improve some tests regarding Ajc output (usage messages etc.)

After Ajc usage text output is filtered into its own category
IMessage.USAGE now - see commit @31b2d60b - some tests in module
'org.aspectj.ajdt.core' were failing. I fixed and also improved them a
bit.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoJava 16 fix: ParseUtil.fileToEncodedURL(File) causes IllegalAccessError
Alexander Kriegisch [Sun, 21 Mar 2021 10:12:48 +0000 (17:12 +0700)]
Java 16 fix: ParseUtil.fileToEncodedURL(File) causes IllegalAccessError

Migrate 'ParseUtil.fileToEncodedURL(f)' to 'f.toURI().toURL()'.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoUpgrade GitHub CI workflow from Java (8, 11, 15) to (8, 11, 16)
Alexander Kriegisch [Sat, 20 Mar 2021 19:19:57 +0000 (02:19 +0700)]
Upgrade GitHub CI workflow from Java (8, 11, 15) to (8, 11, 16)

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 16 test suite for AspectJ 1.9.7 + test refactorings
Alexander Kriegisch [Sat, 20 Mar 2021 19:16:20 +0000 (02:16 +0700)]
Add Java 16 test suite for AspectJ 1.9.7 + test refactorings

- Test all features which were preview in 14+15 and are now final in 16,
  compiling them with language level 16.
- For Java 15 we only have sanity tests (and of course the Java <14
  tests), compiling Java 16 features to target 15 does not seem to work.
- Test remaining Java 16 preview feature (sealed classes).
- Instead of overriding runTest(String) in several base classes like
  XMLBasedAjcTestCaseForJava*Only or XMLBasedAjcTestCaseForJava*OrLater,
  we now override setUp() from JUnit's TestCase base class. This will
  run before runTest(String) and make the tests fail much faster, if a
  user tries to run them on the wrong VM.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoRemove module 'run-all-junit-tests' from root POM -> speed up the build
Alexander Kriegisch [Sat, 20 Mar 2021 11:37:22 +0000 (18:37 +0700)]
Remove module 'run-all-junit-tests' from root POM -> speed up the build

This module must be a relic from a test runner module once existing
during the Ant build era, but transferred and kept alive in the Maven
build. Actually, it almost doubles build time by running virtually all
tests in all modules again when doing 'mvn test' from the project root.

For now I only removed the module from the root POM, leaving behind
comments there, in the module POM and in the now @Deprecated class
RunTheseBeforeYouCommitTests.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix MultiProjectIncrementalTests.testInvalidAspectpath_pr121395
Alexander Kriegisch [Sat, 20 Mar 2021 09:11:12 +0000 (16:11 +0700)]
Fix MultiProjectIncrementalTests.testInvalidAspectpath_pr121395

It failed with "RuntimeException: I never heard about what kind of build
it was!!" on my (@kriegaex) Windows machine, mostly because in case of a
failing full build the corresponding status is never set.

TODO: Ensure that 'MyStateListener.informedAboutKindOfBuild' is set for
failed builds, too.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix tests not finding project base directory 'org.aspectj'
Alexander Kriegisch [Sat, 20 Mar 2021 07:45:51 +0000 (14:45 +0700)]
Fix tests not finding project base directory 'org.aspectj'

Several LTW tests using class TestServer failed on my machine because
there was a hard-coded project base directory name 'org.aspectj' in the
class. This class has several other problems, but my quick fix for now -
I did not want to rename my project base directory - was to match on a
regex '(?i)(org[.])?aspectj' now. That also works for my root directory
'AspectJ'.

I also moved the code determining the project dir into a protected
(hence testable) method and added a sanity test case checking if the
directory can be determined. If not, the test will fail with a rather
lengthy warning to developers about the need to have a matching project
root folder.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix tests expecting usage texts as failure outputs
Alexander Kriegisch [Sat, 20 Mar 2021 07:37:13 +0000 (14:37 +0700)]
Fix tests expecting usage texts as failure outputs

This is a follow-up on commit @31b2d60b. Some tests were actually
expecting usage texts as failure outputs. Because that was fixed, the
tests no longer see those failures, hence they should no longer expect
them.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix test relying on JVM warning being stripped from output
Alexander Kriegisch [Sat, 20 Mar 2021 07:25:39 +0000 (14:25 +0700)]
Fix test relying on JVM warning being stripped from output

The line in which warnings like "Archived non-system classes are
disabled because the java.system.class.loader property is specified"
appears can start with e.g."OpenJDK 64-Bit Server VM" or "Java
HotSpot(TM) 64-Bit Server VM". Therefore, an exact match on the former
worked on Linux, but not on Windows, or maybe the difference is
generally between Oracle and OpenJDK. anyway, I use Oracle on Windows
and my build failed. Now it is fixed because I made the match more
generic using a regex.

I also removed a now obsolete check for the occurrence of the stripped
line in test "JDK14 LTW with XML".

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove usage text, error and warning output in batch compiler
Alexander Kriegisch [Sat, 20 Mar 2021 03:24:57 +0000 (10:24 +0700)]
Improve usage text, error and warning output in batch compiler

- Usage texts are now printed to stdOut, no longer stdErr.
- 'java ...Main -?' no longer prints usage text twice (once to stdOut
  and then again to stdErr).
- AjdtCommand.inferKind: Usage texts are no longer mis-identified as
  warnings or errors just because they contain substrings "warning" or
  "error". Matching is now more precise, looking for "[warning]" and
  "[error]". But in that case the method would not be called anyway
  because errors and warnings are identified in other ways already. As a
  fall-back, the categories IMessage.ERROR and IMessage.WARNING still
  exist in the method.
- In case of compile errors, no usage message is printed anymore,
  because previously the user had to scroll up a lot in order to see the
  actual messages. This is also in line with ECJ. The same is true for
  warnings, but it was like this in Ajc already.
- AjdtCommand.inferKind: There is a new category IMessage.USAGE
  especially for AspectJ usage texts, which will be identified by string
  matching and then correctly handled (i.e. printed to stdOut, not
  stdErr).
- Usage text printing is no longer done in AspectJ but in the AspectJ
  "shadows" fork of JDT. This helps to get rid of some now obsolete code
  here.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoImprove batch compiler usage messages
Alexander Kriegisch [Sat, 20 Mar 2021 03:07:12 +0000 (10:07 +0700)]
Improve batch compiler usage messages

- Use spaces instead of tabs for indentation.
- Document parameters bound in Eclipse JDT, e.g. {0} is not the compiler
  name there but the system's path separator ';' or ':'. So if we want
  to display the compiler name, we need {1}.
- For both normal usage and '-X' usage, compiler name + version are
  printed now.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoFix invalid manifests leading to "Could not find or load main class"
Alexander Kriegisch [Fri, 19 Mar 2021 15:00:09 +0000 (22:00 +0700)]
Fix invalid manifests leading to "Could not find or load main class"

WARNING: Please avoid line breaks in manifest values! They are passed on
like this: Assembly Plugin -> Plexus Archiver -> JRE java.util.jar
.Manifest.write(OutputStream).

The JRE Manifest class inserts hard line breaks always after 72
characters, no matter if those 72 characters contain line feeds, tabs or
spaces. Hence, it can happen that unwanted blank lines end up in the
middle of a manifest section, making the manifest invalid. Calls like
e.g. 'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then
fail with the absolutely unexpected error 'Could not find or load main
class org.aspectj.tools.ajc.Main'.

In IntelliJ IDEA you can deactivate wrapping text inside XML tags like
this: "File | Settings | Editor | Code Style | XML | Wrap text -> off"

The problem occurs in Maven Assembly in versions higher than 2.2. More
exactly, it occurs in Plexus Archiver after in more recent versions it
switched to using the JRE Manifest class.

TODO 1: Either add a test step in phase 'verify' doing something like
this:

new Manifest(new FileInputStream("MANIFEST.MF"));

This would lead to "IOException: invalid header field (line xy)" in case
of an invalid manifest file.

TODO 2: Or file a JRE bug at Oracle or OpenJDK, wherever appropriate.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoStrip down compiler messages to AspectJ-specific ones
Alexander Kriegisch [Fri, 19 Mar 2021 06:37:54 +0000 (13:37 +0700)]
Strip down compiler messages to AspectJ-specific ones

Delete all properties from messages_aspectj.properties which were just
copied from Eclipse and basically the same. This not only gets rid of
duplicates but also eliminates differences found between upstream and
AspectJ strings which were just cause by errors or oversights during
manual upgrade.

TODO:
  - Find a way to print the '-X' options as info instead of yielding
    'abort', making it seem as if compilation failed and print the usage
    message to stdErr instead of stdOut.
  - Eclipse also has misc.usage.warn, not just misc.usage, i.e. usage
    info specifically for warning options. Make sure that AspectJ uses
    it consistently.
  - Find a way to merge AspectJ-specific options into the standard
    Eclipse usage text instead of completely replacing it, further
    reducing the need to merge and copy upstream content.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoBegin migration to 'aspectj' locale for compiler messages
Alexander Kriegisch [Fri, 19 Mar 2021 04:08:35 +0000 (11:08 +0700)]
Begin migration to 'aspectj' locale for compiler messages

Renamed messages.properties to messages_aspectj.properties and moved to
a path identical with the Eclipse original resource file. Therefore, it
is now just treated as a localised version of it.

The new jdtcore-for-aspectj.jar already contains logic to use the new
locale. Hence, BuildArgParser no longer needs the static block to
initialise its own resource bundle, Eclipse JDT will automatically pick
it up.

The version string was also updated to the new Eclipse merge commit
hash + date + "Java16".

TODO: Strip down properties file in order to only contain delta to
Eclipse.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years agoAdd Java 15 / AspectJ 1.9.7 test suite 36/head 38/head
Alexander Kriegisch [Wed, 17 Mar 2021 16:38:08 +0000 (23:38 +0700)]
Add Java 15 / AspectJ 1.9.7 test suite

Also fix some minor details in Java 14 suite

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>