102 Commits

Author SHA1 Message Date
cad5f0e564 Fix #163: Make sure modules are compiled correctly with ant (#164)
Now with Apache ant to ensure compilation of a Java component as module,
it is now necessary to provide a `module-info.java` file and use **Java
11 or later**.
2025-05-26 08:22:40 +02:00
baf6a290b8 Fix #160: RegistrationHandler template fix (#161) 2025-04-14 15:29:12 +02:00
842cc81bea Fix #156 Passive registration fix (#157)
This passive registration registers all UNO services that are present in
a component's Java or Python implementation. This fixes issue #156.

To be considered as a UNO service a Java Class must have:
- An ctor with `com.sun.star.uno.XComponentContext` as unique parameter.
- A **static final** field `m_serviceNames` of type `String[]` (ie: an
array of String) and having as values the name of the UNO service. This
field can be private, protected or public, it doesn't matter.

For a Python class to be considered a UNO service it must:

- Exist a global variable `g_ImplementationHelper` declared as follows:
`g_ImplementationHelper = unohelper.ImplementationHelper()`.
- Exist a global variable `g_ImplementationName` declared as follows:
`g_ImplementationName = 'com.sun.star.MyServiceName'`.
- Exist a global variable `g_ServiceNames` declared as follows:
`g_ServiceNames = ('com.sun.star.task.JobExecutor', )`.
- Although this is not controlled, it will also be necessary for it to
have the following code:

```
g_ImplementationHelper.addImplementation(YourPythonClass,         # UNO object class
     g_ImplementationName,                                        # Implementation name
     g_ServiceNames)                                              # List of implemented services
```
2025-04-14 11:27:35 +02:00
9808cdfb0a Fix 57: Passive component registration (#152) 2025-03-27 07:00:55 +01:00
a3ce0b61d9 Tracking Eclipse .classpath changes (#146)
In order to improve the integration of **Ant** and `javac` now changes
to the Eclipse `.classpath` file will produce an update to the
`build.properties` file. This file has a new property
`uno.java.classpath` that allows to provide `javac` with all the
necessary dependencies when compiling.

If in Eclipse a sibling project is declared as a dependency then either
its jar archive (if it was produced by a `Build.jardesc` file) or its
`bin` folder (the folder where Eclipse puts the `.class` files) will be
available in the `uno.java.classpath` property of the `build.properties`
file.

This allows us to have compilations with `javac` (ie: **Ant**) that work
just as well as compilation by Eclipse's internal compiler.

Concerning the Java jar archives to be put in the `MANIFEST.MF`
`Class-Path` of a UNO Java project, there are two ways to do it:
- Either create a `lib` or `libs` folder at the root of the UNO project.
In this case all archives put in this folder are put in the `Class-Path`
of the `MANIFEST.MF`.
- In the absence of a `lib` or `libs` folder, all archives local to the
project and declared in the Eclipse build path will be put in the
`Class-Path` of the `MANIFEST.MF`.
2025-02-13 15:33:24 +01:00
2a185241bd Fix #142 Non-UNO project management (#143)
- Only UNO projects and not configured by default will be listed in Eclipse.
- The Ant script requires version 1.9.1 minimum and will let you know if necessary.
- It is possible to change the SDK of any project.
2025-02-03 07:49:05 +01:00
e29b319176 Fix #136, Fix #140 Recognize modular projects (#141)
If in Eclipse you have declared a Java version 9 or higher and there is
a file named **module-info.java** in the source folder then Eclipse will
automatically add the necessary libraries in the module path and no
longer in the class path as for a non-modular project.

Similarly LOEclipse will add the necessary LibreOffice libraries in the
module path if the project is modular.
Regarding the build of the oxt file, only the Ant script has been
updated to take into account the creation of modular archives.
2025-01-30 07:58:24 +01:00
d2a3c56ea2 Fix #130 Support for SDK 24.x (#135)
Here is an update taking into account the idl file compilation utility
**unoidl-write** (see issue #130)

- Now if you change the LibreOffice and SDK version of a project (ie:
Project -> Properties -> LibreOffice Properties) then the
build.properties file will be updated if it exists.
- When generating the Ant script (ie: Project -> Export -> LibreOffice
-> Generate Ant script file) the build.properties file will be created
if it does not exist.
- The main builder of the UNO-IDL (ie:
org.libreoffice.ide.eclipse.core.builders.TypesBuilder.java) will
automatically switch to the utility provided by the SDK (ie: idlc or
unoidl-write) if it changes.
- The Ant script has been updated to take into account unoidl-write and
the different filenames on Windows (ie: unoidl-write vs
unoidl_write.exe).
- Many corrections on the integration of SDK tools have been made in
order to support Windows. However, concerning Windows, no tests has be
done because I am not able to do them.
2025-01-25 15:53:29 +01:00
847ce5f9a5 Fix Eclipse warnings (#126)
- In order to take advantage of the warnings in Eclipse the
**CheckStyle** plugin has been restarted (ie: it was no longer correctly
configured) and all files whose code did not meet the requirements of
the `/build/checkstyle.xml` file have been updated. It is expected that
the file headers (license and copyright) will be modified in order to
avoid the last warnings still visible in Eclipse.
- Java 17 is now the minimum version. This seem to be required by the
various Eclipse archives that LOEclipse uses (ie: org.eclipse.jdt).
- The template java file
`java/source/org/libreoffice/ide/eclipse/java/registration/RegistrationHandler.java.tpl`
has been rewritten using generics so that Eclipse warnings stop.
- The test file
`core/source/org/libreoffice/ide/eclipse/core/wizards/pages/ManifestExportPageControllerTest.java`
has been moved to the
`core/source/org/libreoffice/ide/eclipse/core/unittests` folder to allow
error-free compilation. This seems to fix [issue
#125](https://github.com/LibreOffice/loeclipse/issues/125).
- All Java methods marked as deprecated have been updated to their
replacement method.

Following this PR there are still in the Eclipse problems:
- 21 warnings including 4 TODO.
- 72 infos corresponding to the file headers (license and copyright).
2025-01-13 07:50:50 +01:00
67437ab79f Improved management of package.properties file (#123) (fix #117, fix #119)
An uncompressed mimetype file at the beginning of the oxt files has been added. It is supposed to help with the recognition of the oxt file type on Apple platforms.

Updating the package.properties file will be done either through the CheckBoxTreeViewer or through the text editor. Changing one will change the other. The loading of this window has been optimized (a few seconds).

Files and directories that are symbolic links are now visible in the CheckBoxTreeViewer (ie: no more filtering) and taken into account in the build of oxt archives. This allows to benefit from a single source for the location of libraries and therefore easier updates.
2024-12-23 14:56:04 +01:00
179c20d26b update error handling for checking the RegistrationHandler.classes file. (#104)
1. extend the error info when the file RegistrationHandler.classes does not exist in the package defined by company prefix and outputextension
2. display the error dialog in syncExec thread
3. throw an exception when error with RegistrationHandler.classes file
2023-04-20 08:46:03 +02:00
9b66c3e0ba Fix #85 Check libs subfolder on uno package creation (#102) 2023-04-03 09:27:14 +02:00
5310fc6ec6 Fix typo in method name 2020-08-25 14:26:09 +02:00
31a785bd7a Remove noise from file header 2020-06-15 14:58:27 +02:00
5957a2a5cf Support LibreOffice 7.0
Which moved java stuff to libreoffice.jar
See https://wiki.documentfoundation.org/ReleaseNotes/7.0#Java_support for details
2020-06-15 14:39:07 +02:00
9207446a8d add debug when collecting jars from lib dir 2020-06-15 12:37:45 +02:00
074eab804c added Gradle/Buildship support:
When subdir "libs" in Project root dir exist, then all the Jars are used as external libs.
1. Listet into the main-jar meta.inf file
2. Copied into the generated otx file
2020-06-15 12:37:28 +02:00
0388dd3dfd Fix for build failing when build dir is empty 2019-07-16 10:44:44 +02:00
8dc344f3a7 Fix running javamaker with spaces in project path (#72) 2019-06-26 08:17:31 +02:00
635bd9b7df Enabling Python nature to the project and fixing changes for 25-Jun-18 2018-10-26 19:05:52 +02:00
99cba30f21 Phase 2:Changes discussed in mail and chat (build.xml & skeleton file) 2018-10-26 19:05:52 +02:00
4289807cea Phase 1: Changes as discussed in mail and chat 2018-10-26 19:05:52 +02:00
3113b244f6 Fix #21: Show error when RegistrationHandler.classes empty (#67)
show an error message when RegistrationHandler.classes is empty
2018-05-14 11:55:44 +02:00
7842ff7703 Fix #52 Create a separate export Ant script option (#66)
Before this was hidden in the export package dialog and hard to discover
2018-03-26 09:31:22 +02:00
e83437d472 Related #38: Follow-up fix for 22c4c13 2017-03-10 11:00:33 +01:00
22c4c133de Fix #38 Prefill build.properties with current LO&SDK installation (#46) 2017-03-10 10:59:52 +01:00
c1aba2a7c9 Fix #43: Remove java version selector from extension wizard (#44) 2016-12-12 15:41:45 +01:00
3e2d503b38 Fix #41 Wrong classpath syntax for multiple jars
Need to use space as delimiter instead of comma
2016-09-28 09:41:56 +02:00
d58a343a91 Fix #40 wrong path separators in jar manifest 2016-09-27 15:16:52 +02:00
80d6fae0ac Ant script: Remove superfluous lines from build.properties 2016-08-26 09:06:19 +02:00
66cb65d475 Ant file: Mention required setup 2016-08-25 14:03:26 +02:00
570c63f4ca Ant file: Mention external libraries 2016-08-25 12:58:17 +02:00
6b04ac2df5 Fix #35 Bring ant build up to date 2016-08-25 12:33:47 +02:00
8ff24bd323 Remove @author annotations #18 2016-08-18 12:15:46 +02:00
2edea87eed Fix #36 Java libs wrongly declared as UNO Typelibrary
Instead add them to the main jar's classpath
2016-08-16 16:11:42 +02:00
7791a507ed Enable test generation by default again
Now that they work, it makes sense to have them
2016-07-21 09:42:09 +02:00
f33cdc6a87 Fix #33 Migrate tests to JUnit 4
This also fixes #13 (Cannot run tests)
2016-07-21 09:36:59 +02:00
2280131ec4 Fix #29: Don't wait for all processes to finish before printing anything
This partially reverts 78101deeae and
34bf0ccc98
2016-06-10 12:31:56 +02:00
589081ee7e Restore possibility to handle multiple LO & SDK instances
This is still useful, although I thought otherwise before.

Revert "Unused import"

This reverts commit 66a76e1993.

Revert "Cleanup"

This reverts commit cc5c1991d1.

Revert "Unused variable"

This reverts commit ab08658164.

Revert "Validate LO&SDK in the new extension wizard"

This reverts commit d2cc87083f.

Revert "Remove blank comments"

This reverts commit 4c888aba3f.

Revert "Fix #18 Remove unnessessary @author annotations"

This reverts commit 7b4e1dc01c.

Revert "Validate LibreOffice & SDK on field change"

This reverts commit 8f361bcbe5.

Revert "Fix #10: Easier Management of LibreOffice & SDK instances (#19)"

This reverts commit 35954bb34d.
2016-06-08 13:44:20 +02:00
4eca1fa105 Use Map as type, not HashMap
and use Java 7 syntax to avoid redundancy
2016-05-25 16:19:45 +02:00
4c888aba3f Remove blank comments 2016-05-13 18:16:00 +02:00
7b4e1dc01c Fix #18 Remove unnessessary @author annotations 2016-05-13 18:02:28 +02:00
35954bb34d Fix #10: Easier Management of LibreOffice & SDK instances (#19)
* Allow only one LibreOffice & SDK instance per workspace
* Don't write selected LibreOffice & SDK to .unoproject (Allow versioning)
* Cleanup
2016-05-13 11:08:22 +02:00
774cbaac66 Unused imports 2016-05-13 10:22:34 +02:00
34bf0ccc98 Fix javamaker argument order
and remove unneccessary debugging output (will be handled in runTool)
2016-05-13 10:19:14 +02:00
3822570b35 Javamaker no longer supports the -B option
Since LibreOffice 4.1
https://wiki.documentfoundation.org/ReleaseNotes/4.1#javamaker_.2F_cppumaker
2016-05-10 15:36:54 +02:00
78101deeae Show error when a system command fails 2016-05-10 13:50:28 +02:00
13d789109a FTW: Don't generate tests by default 2016-04-04 16:15:21 +02:00
6b7b1a4f05 Rename: openoffice -> libreoffice 2015-12-10 12:11:58 +01:00
058696f96d Convert Windows line endings to Unix 2015-12-10 10:49:00 +01:00