Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated pipeline for addin/windows build #5

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

NPavie
Copy link
Contributor

@NPavie NPavie commented Oct 10, 2022

This PR regroup the changes made for the embedded version of the pipeline (pipeline "lite") used in the save as daisy addin.
Most of the changes are targetting the windows UI and the pipeline "lite" created by the "build-addin" ant script.

To test the resulting changes on windows, the build of the pipeline "lite" (in 32 bit version) can be done using ant -f build-addin.xml.
Note that you will need both maven and ant toolchains installed for the build.

Changelog

  • Adding back the "daisycmfui" (the win32 UI) code base reimported from sourceforge
    • Maven is now required in the PATH for the build process, as the project build toolchain has meen moved from eclipse to maven
  • Updated SAPI bridge using a newer version of the com4j library
  • Fixed an audio speed issue with with the lame command line call
  • Added a 32bit embedded 1.8 AdoptOpenJDK JRE for embedded pipeline distribution
    • A newer version icu4j is included to fix a dll architecture issue
    • Compilation of the code now targets java 1.8

A dtbook xml post processing script has also been added for the addin, that includes the possibility to tag the sentences.

@bertfrees
Copy link
Member

bertfrees commented Oct 11, 2022

Hi Nico,

This all looks very good!

It's a massive change though. Much bigger than I expected. That makes it not so easy to review, also because it's not always very clear what exactly changes in the individual commit. If it is possible to squash certain commits, please don't hesitate to do so as that might make the reviewing easier. On the other hand you may also split up certain commits if that makes sense.

I will be adding some comments and questions in the diffs. They may seem dumb questions because I'm not really familiar with the Pipeline 1 code.

@rdeltour
Copy link
Member

Wow, big and useful work @NPavie 👏. I'll review the details ASAP.

@NPavie
Copy link
Contributor Author

NPavie commented Oct 14, 2022

small questions @bertfrees @rdeltour :
i kind of just made the PR from my working branch but it occurs to me that it might be hard to review in this state ^^'.
Before starting the review, it might be better if i clean up a bit the commits to squash some into one.
I can do that on monday to ease a bit the process if it's ok for you to wait a bit.

(+ i could try to isolate in a single commit the files updated by com4j, that may be the bigger code changes as i regenerate the bindings with the updated version of com4j)

@NPavie
Copy link
Contributor Author

NPavie commented Oct 24, 2022

Hi @bertfrees and @rdeltour , i finished a reorganisation of the commit and their content.

2 commits are still a bit big regarding changes :

  • 4143ee2 contains lots of changes due to speechgen2 classes being regenerated using a newer version of com4j toolset.
  • fba71f3 contains the reintegration of the daisycmfui svn repo within the pipeline repo.
    • One major change in it is the migration of eclipse based build to maven projects for those libraries, including an aggregator to simplify the build.

@bertfrees
Copy link
Member

Wonderful @NPavie. That makes it a lot clearer! I will add some small suggestions in the diffs.

@bertfrees
Copy link
Member

The "Win32 UI reintegration" commit needs some more explanation. Perhaps some more words in the README? What exactly is the source code that has been added? It looks like only the stuff in the "bundles" directory has been ported. This seems right because we only need the code that is required to build the Pipeline Lite component. It makes no sense to import the whole thing. However we need to think about whether this is indeed how we want to organize the code, and if so what are the next steps. Presumably the "bundles" directory is also still needed in the daisymfcgui project to build it. But is the code duplication a good idea?

build-addin.xml Outdated Show resolved Hide resolved
build-core.xml Outdated Show resolved Hide resolved
build-core.xml Outdated Show resolved Hide resolved
build-deb.xml Outdated Show resolved Hide resolved
build-obi.xml Outdated Show resolved Hide resolved
build-addin.xml Outdated Show resolved Hide resolved
build-addin.xml Show resolved Hide resolved
daisymfcgui/pom.xml Outdated Show resolved Hide resolved
daisymfcgui/org.daisy.pipeline.lite/build.properties Outdated Show resolved Hide resolved
daisymfcgui/org.daisy.pipeline.lite/.classpath Outdated Show resolved Hide resolved
- removed internal proprietary functions from sun
- Added lame 3.1 and AdoptOpenJDK runtimes
- updated commons-io, icu4j and com4j libraries
 - We keep the unzipped version of the dll aside as NullPointerException
  can be raised by com4j if it fails to unzip its dll.
- Updated ant scripts
- updated build for pipeline-lite (embedding jre)
- Switch source and target java version to 1.8

Also removed unnecessary eclipse build file.
Using correct option --cbr in lame command line call
- Added com4jtools for classes generation
- Regenerated speechgen classes
- Updated build sapi to use embedded com4j toolset
New pipeline scripts are defined for SaveAsDAISY addin : 
- The _postprocess script allows to use post-treatment routines on 
  dtbook XML generated by the addin, like cleanups and sentences tagging
- The default script converts dtbook xml into DAISY books

A new "buildDistForWin" ant target is set to generate the pipeline 
directory to be included in the addin ressources.
- Merging the repo with the daisy cmf UI svn repository of sourceforge
- Preparing maven projects to automate jars rebuild and dependencies
for the addin version of the pipeline
Adding informations regarding requirements, core and lite building of
the pipeline.
.classpath Outdated Show resolved Hide resolved
.classpath Outdated Show resolved Hide resolved
Comment on lines +66 to +83
<include name="_dev/_postprocess.taskScript"/>
<include name="_dev/default.taskScript"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use more explicit names for these new scripts? (later down the road, when we forget about all this, it may not be obvious that _postprocess and default are made for the AddIn)

@NPavie
Copy link
Contributor Author

NPavie commented Oct 25, 2022

The "Win32 UI reintegration" commit needs some more explanation. Perhaps some more words in the README? What exactly is the source code that has been added? It looks like only the stuff in the "bundles" directory has been ported. This seems right because we only need the code that is required to build the Pipeline Lite component. It makes no sense to import the whole thing. However we need to think about whether this is indeed how we want to organize the code, and if so what are the next steps. Presumably the "bundles" directory is also still needed in the daisymfcgui project to build it. But is the code duplication a good idea?

I'll update the readme to indicate what was the svn repo holding (the graphical user interface libraries required to launch the pipeline in graphical mode).
I'll check if there was a readme on the svn repo and take it back.

I had to check back the content of the svn repository because i did not understood what you were talking about with "bundles" directory.
From what i understood, the "bundles" directory contains the actual code of the ui libraries, but for the svn repo content you will have to ask @rdeltour.

i'm not sure to understand what you want exactly or what you mean with "code organization" and "code duplication", and if there are next steps, what are the targetted goals regarding this part of the code base.

@bertfrees
Copy link
Member

If I look at the SVN repo I see a lot of code. The "bundles" directory seems to match what you have imported. So this part of the code lives in two places now. I'm just asking the question whether this is a good idea, whether we need to think more about how to best organize the code.

NPavie added 2 commits March 28, 2023 14:12
- Content of the previous daisymfcgui folder is moved to gui/bundles
- Some notes and previous version of code that were kept in the svn repos have not been copied.
- Updated ant and maven build for the addin
@NPavie
Copy link
Contributor Author

NPavie commented Mar 29, 2023

Hi @bertfrees and @rdeltour, i did an update yesterday with the 3 last commits :

  • The svn repository of the ui project is now completely imported
    • Building will require some analysis on my side so it might take some time.
  • The core code is now compiled with java 11 set as source and target
  • icu4j has been updated to 72_1
  • The jre to be used for the add in version of the pipeline is now the OpenJDK11 jre.

I was able to run the code pipeline command line ui class from intellij without any problem (including launching a script), but i have a small problem i'm still working on :
Launching the program from the bat seems to break the parameter analysis process.

To be more clear:
This works perfectly and give me the list of required inputs

pipeline.bat -i scripts\verify\DTBookValidator.taskScript

But if i try to provide the input for the script, it says it does not find the parameter:

pipeline.bat scripts\verify\DTBookValidator.taskScript --input="C:/Users/npavie/Downloads/FR-AVH_9700000000000_dtbook.xml"

(It says Error: invalid parameter '--input')

@bertfrees
Copy link
Member

bertfrees commented Mar 29, 2023

The svn repository of the ui project is now completely imported

OK, so what we have now is the whole daisymfcgui repo within the pipeline1 repo. That makes sense I guess. So from now on if someone wants to build or modify the daisymfcgui project, he can checkout the pipeline1 repo.

For continuity it would be nice if there were one commit that adds an exact revision of the daisymfcgui repo, and then one or more commits that do additional changes. I've tried to do this. First I added revision 658 and then I compare with your import. I'm seeing more differences than I expected. I have pushed to a513118. @NPavie Can you please check and tell me which differences are intentional and which aren't?

Launching the program from the bat seems to break the parameter analysis process

Is there a specific commit that broke things?

- Switch to java 11
- Updated icu4j to 72_1
@NPavie
Copy link
Contributor Author

NPavie commented Mar 31, 2023

Is there a specific commit that broke things?

Nop, no commit, but checking the bat execution : the "=" is considered as an argument separator by both powershell and the windows CMD terminal ...

If i understand your commit, the main differences i see seems to be the changes i made for the addin build using maven instead of the eclipse buildchain.
(i realize there might be some generated code that i commited by mistake, but i'm not 100% sure, i'll need to check that)

- Updated gitignore files
- remove the dot folder coming from the old buildchain
- pipeline et util libs used by the bundle now injected in the bundles
local maven repository
@NPavie
Copy link
Contributor Author

NPavie commented Mar 31, 2023

So for the "@dot" folder in the commit, it was indeed a relicate of code that came from the previous build chain.

I updated the gitignore to avoid commitings libs that are copied during the build process (and are used by the ant process afterward).

The core pipeline jars (the pipeline and util jar that are needed in the bundles aggregator) are copied to the local maven repo that is used to keep the eclipse required version of the libs that are not available in maven standard repositories.

Batch consider the '=' character as a separator
when extracting parameters from command line.
@bertfrees
Copy link
Member

@NPavie Thanks. These are now your total changes to daisymfcgui repo: f94da97. I'm still wondering about the gui/bundles/org.daisy.pipeline.lite/rsrc directory. Where did that come from?

@NPavie
Copy link
Contributor Author

NPavie commented Apr 5, 2023

If i recall, i needed those properties files for the pipeline lite build.
I took the properties file from a prebuild archive @rdeltour provided a while back.
I don't exactly recall why i needed the ico file (propably an icon i used for launch4j directly, before switching to the maven plugin to call it directly)

@bertfrees
Copy link
Member

bertfrees commented Apr 6, 2023

@rdeltour Do you remember how to use git-svn? I've run

git svn clone https://svn.code.sf.net/p/daisymfcgui/code/trunk --stdlayout daisymfcgui

and waited a day but I'm not sure if it's doing something.

@rdeltour
Copy link
Member

rdeltour commented Apr 6, 2023

I don’t remember, it’s been a while I haven’t used it. Have you tried standalone svn first to see if the repo is working and in good shape?
I can have a look at this next week.

@bertfrees
Copy link
Member

@rdeltour Yes, svn worked. That is how I was able to compare the upstream version with Nico's changes.

@bertfrees
Copy link
Member

This command does seem to work (http instead of https):

git svn clone http://svn.code.sf.net/p/daisymfcgui/code/trunk --stdlayout daisymfcgui

@bertfrees
Copy link
Member

I have pushed the migrated repo to https://github.com/daisy/pipeline1/tree/daisymfcgui.

@bertfrees
Copy link
Member

The merge has been done in a5e5b0c.

@bertfrees
Copy link
Member

@NPavie I've rebased the branch and pushed to "dev-npavie-clean". Could you please verify I didn't mess up? Does everything still work?

@NPavie
Copy link
Contributor Author

NPavie commented Sep 20, 2024

@bert following christian remarks today (I had completely forgot about the PR)

I tested the branch dev-npavie-clean branch and I confirm the build-addin ant file still builds on my side with OpenJDK 11 (even though it's not used any more as pipeline 1 is now replaced by pipeline 2 in SaveAsDAISY)

@bertfrees
Copy link
Member

OK :-) Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants