You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 lat temu
3 lat temu
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Contributing to AspectJ
  2. AspectJ is a maven project, as such it should import cleanly into your IDE. The project uses github for issue tracking ( https://github.com/eclipse/org.aspectj/issues ).
  3. ## Working on the codebase
  4. ### Importing the project
  5. #### Eclipse
  6. Simply run the maven project importer and point it at the root of the cloned AspectJ repository. This will import all of the AspectJ
  7. modules.
  8. Each module comes with its own testsuites however there is a module called `run-all-junit-tests` - within there is a file `RunTheseBeforeYouCommitTests` which you can launch as a JUnit test (rightclick -> RunAs -> Junit Test).
  9. This will run a few thousand tests to verify your IDE import.
  10. Some tests are conditional based on the JDK you are using in your IDE since they are exercising features only available in recent Java.
  11. In order to execute all possible tests ensure you are running the tests with the latest available Java JDK release.
  12. A JRE will likely not suffice because tools like javadoc will be invoked from the tests.
  13. #### IntelliJ
  14. TODO
  15. ### Developing tests
  16. If developing system tests based on the sources for complete Java applications, follow the pattern in the `tests` module.
  17. For each version of AspectJ there is a `bugsNNN` folder with subfolders for each issue.
  18. Then there is a pair consisting of a test specification in a `ajcNNN.xml` file in the `src/test/resources` folder and a `AjcNNNTests.java` source file in the `src/main/java` folder.
  19. Simply follow the pattern for previous versions to add a new suite for a new version of AspectJ.
  20. Alongside the `AjcNNNTests` file you might add other test suites for particular new language features of Java.
  21. All these suites are then pulled together in a `AllTestsAspectJNNN.java` suite.
  22. In turn the suites are pulled together in a `AllTestsNN` suite for the major version of AspectJ, and so on.
  23. Creating a test is then this basic process:
  24. - create a new folder based on the issue number in the correct `bugsNNN` folder.
  25. Add the relevant material into that folder (.java sources, any resources, xml files, etc).
  26. - Create a definition of the test steps ('build these files', 'package this jar from these classes') in the correct `ajcNNN.xml` file in the `src/main/resources` area.
  27. - Created a test in the correct `AjcNNNTests.java` file that references the specification written in the XML.
  28. ### Compiler issues
  29. AspectJ is based on a modified Eclipse JDT that is using a modified grammar, extended to support AspectJ constructs.
  30. This modified compiler exists in a separate repository: https://github.com/eclipse/aspectj.eclipse.jdt.core
  31. Some issues involving compiler problems, for example if Java code isn't working because a variable was named after an AspectJ keyword - these issues must be worked on in that other project, even though the tests for that will likely live in this project.
  32. ## Contributions
  33. Please contribute via Pull Request against the GitHub repository.
  34. Contributors should ensure they have signed the [Eclipse Contributor Agreement](https://accounts.eclipse.org/user/7644/eca/3.1.0), this will be verified by automatic validation that occurs against any Pull Requests.