JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

RMIR Source Reconfiguration

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Software
View previous topic :: View next topic  
Author Message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Sun Sep 06, 2020 11:36 am    Post subject: RMIR Source Reconfiguration Reply with quote

I have reconfigured the trunk/km folder in the SourceForge SVN to support the use of Maven instead of Ant for compiling RMIR and building its binary distro. Everything required to build the distro is now in the trunk/km folder, including all RDF, map and image files that are now in the trunk/km/remotes subfolder. This supersedes the trunk/remotes folder previously used as the repository of RDFs, maps and images, which I have therefore deleted.

The km folder used to hold everything needed to compile RemoteMaster.jar but was missing many of the files needed to build the binary distro. Not only were the RDFs, maps and images in a separate folder but also the compiled binaries of DecodeIR and jp12serial needed to be extracted from the folders holding their source code and some files that have remained unchanged for a long time were not present at all and needed to be extracted from an existing RMIR distro. All in all, a big effort for anyone who wished to build the RMIR distro. The separate folders for DecodeIR and jp12serial have of course been retained as they hold their source codes, but the binaries are now also in the km folder to make it complete.

If you install Maven and check out the km folder from the SVN, the build process is now very simple. From a command line with the working copy of the km folder as your current folder, you need to run
Code:
mvn validate

to install local dependencies in your local Maven repository. This is required once only. The command
Code:
mvn package

will then download the remaining dependencies, compile the RMIR source code and build the binary distribution in the target subfolder all in one operation. The same operations can be performed with the Eclipse IDE, so it is not necessary to do it from a command line. For repeat builds it is best to run
Code:
mvn clean

before the package command, which deletes the target folder to ensure that all is rebuilt afresh.

The binary distro has a name of the form RMIR.[version]-bin.zip instead of the current form RemoteMaster.[version].zip but the two are equivalent. The jar file in the zip is still RemoteMaster.jar but it is also present separately in the target folder under a name of the form RMIR-[version]-jar-with-dependencies.jar, which in Maven terminology is a "fat jar". There is also a file RMIR-[version].jar which does not include dependencies, but this has no equivalent in an Ant build.

The three applications that are combined in the jar file have separate shortcuts created by a setup script that are called RMIR, Remote Master and RMPB. With the zip b
package being named RemoteMaster, this has led some new users to assume that Remote Master, the device upgrade editor, is the primary application. It was the original one, but RMIR is now the primary one, which is why I am now using RMIR in the name of the zip package. I prefer to keep RemoteMaster as the name of the overall jar that encompasses all three applications. For that reason I suggest that the shortcut for the device upgrade editor should be renamed as RMDU, in agreement with its file extension, instead of Remote Master. I have not yet done this, so invite comments on the suggestion.
_________________
Graham


Last edited by mathdon on Tue Sep 22, 2020 1:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1186

PostPosted: Tue Sep 08, 2020 9:45 am    Post subject: Reply with quote

Congratulations! Very Happy Very Happy

This is a great step forward. I was able to build it with no problems, and the generated zip file can be installed without problems. (I did not try thee JNI stuff yet.)
"Bundling" the rdfs, images, and maps makes the whole thing easier to install. What does not work is to run "in place", i.e. from the source tree, which is necessary for debugging with Eclipse or Netbeans. Also, some of the selected locations are quite illogical: for example the textfiles directory is a mixture of human readable documentation, html-files to be invoked from the program, setup files and wrappers, and configuration files. There are also other files in somewhat "strange" locations. I will be happy to provide assistance and/or advice.

To make it executable in place is not that hard. Using -home target command line argument, it is enough to copy some files (protocols.ini, digitmap.bin and a few more) to the directory target. I was able to do this with a few lines in pom.xml, using the maven resource plugin:
Code:

      <plugin>
                            <artifactId>maven-resources-plugin</artifactId>
                            <version>3.1.0</version>
                            <executions>
                                <execution>
                                    <id>copy-resources</id>
                                    <phase>validate</phase>
                                    <goals>
                                        <goal>copy-resources</goal>
                                    </goals>
                                    <configuration>
                                        <outputDirectory>${project.basedir}/target</outputDirectory>
                                        <resources>
                                            <resource>
                                                <directory>${project.basedir}/textfiles</directory>
                                                <includes>
                                                    <include>*.html</include>
                                                    <include>protocols.ini</include>
                                                    <include>rmProtocols.xml</include>
                                                </includes>
                                                <filtering>false</filtering>
                                            </resource>
                                            <resource>
                                                <directory>${project.basedir}/setup</directory>
                                                <includes>
                                                    <include>*.css</include>
                                                </includes>
                                                <filtering>false</filtering>
                                            </resource>
                                            <resource>
                                                <directory>${project.basedir}</directory>
                                                <includes>
                                                    <include>digitmaps.bin</include>
                                                </includes>
                                                <filtering>false</filtering>
                                            </resource>
                                        </resources>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>

But there are certainly other ways of doing it.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Tue Sep 08, 2020 10:08 am    Post subject: Reply with quote

I had already discovered the issue of running in place, in Eclipse, and have solved it for myself by setting -home and copying some files as you did, but had not got round to juggling the pom to handle it. Thanks for the suggested fix, which I will study with interest. Please suggest how you think files should be arranged, as you think my way illogical. It was really only a first try and I am happy to change it. The textfiles folder does only contain files that are text but I admit they are a pretty mixed bunch.

Do you have an idea when Girr-2.2.8 and IrpTransmogrifier-1.2.8 will be finalized? I don't see any way of incorporating the SNAPSHOT versions into RMIR other than by including them in libs and having them installed locally. Is there a way, and also one of identifying the revision as I did with the ant build?
_________________
Graham
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1186

PostPosted: Sun Sep 13, 2020 5:31 am    Post subject: Reply with quote

Quote:
Please suggest how you think files should be arranged,


As requested, here is my suggestion for file reorganization of setup/* and textfiles/*, together with corresponding changes to pom.xml and target.xml. The files are here. (with the exception of RMIR.sys, which made the upload too large.) I will also be happy to commit the changes to svn if you so request.

Quote:
Do you have an idea when Girr-2.2.8 and IrpTransmogrifier-1.2.8 will be finalized?

I will address this in the IrpTransmogrifier thread.

Edit: Here a list of changes (svn status)
Code:

A  +    Docs/ChangeLog.txt
        > moved from textfiles/ChangeLog.txt
D       digitmaps.bin
        > moved to src/main/resources/digitmaps.bin
M       pom.xml
D       setup
D       setup/RM.ico
        > moved to src/main/resources/icons/RM.ico
D       setup/RMIR.ico
        > moved to src/main/resources/icons/RMIR.ico
D       setup/RMIR.sys
        > moved to src/main/resources/RMIR.sys
D       setup/RMPB.ico
        > moved to src/main/resources/icons/RMPB.ico
D       setup/linux_xsight.rules
        > moved to src/main/setup/linux_xsight.rules
D       setup/style.css
        > moved to src/main/html/style.css
D       setup/styleie.css
        > moved to src/main/html/styleie.css
M       src/assembly/target.xml
A       src/main/html
A  +    src/main/html/DecodeIR.html
        > moved from textfiles/DecodeIR.html
A  +    src/main/html/IrpProtocols.html
        > moved from textfiles/IrpProtocols.html
A  +    src/main/html/RMPB_Readme.html
        > moved from textfiles/RMPB_Readme.html
A  +    src/main/html/Readme.html
        > moved from textfiles/Readme.html
A  +    src/main/html/style.css
        > moved from setup/style.css
A  +    src/main/html/styleie.css
        > moved from setup/styleie.css
A  +    src/main/resources/RMIR.sys
        > moved from setup/RMIR.sys
A  +    src/main/resources/buildRef.txt
        > moved from textfiles/buildRef.txt
A  +    src/main/resources/digitmaps.bin
        > moved from digitmaps.bin
A       src/main/resources/icons
A  +    src/main/resources/icons/RM.ico
        > moved from setup/RM.ico
A  +    src/main/resources/icons/RMIR.ico
        > moved from setup/RMIR.ico
A  +    src/main/resources/icons/RMPB.ico
        > moved from setup/RMPB.ico
A  +    src/main/resources/protocols.ini
        > moved from textfiles/protocols.ini
A  +    src/main/resources/rmProtocols.xml
        > moved from textfiles/rmProtocols.xml
A       src/main/setup
A  +    src/main/setup/Setup.vbs
        > moved from textfiles/Setup.vbs
A  +    src/main/setup/irptransmogrifier.bat
        > moved from textfiles/irptransmogrifier.bat
A  +    src/main/setup/irptransmogrifier.sh
        > moved from textfiles/irptransmogrifier.sh
A  +    src/main/setup/linux_xsight.rules
        > moved from setup/linux_xsight.rules
A  +    src/main/setup/rmaster.sh
        > moved from textfiles/rmaster.sh
A  +    src/main/setup/rmir.sh
        > moved from textfiles/rmir.sh
A  +    src/main/setup/setup.sh
        > moved from textfiles/setup.sh
D       textfiles
D       textfiles/ChangeLog.txt
        > moved to Docs/ChangeLog.txt
D       textfiles/DecodeIR.html
        > moved to src/main/html/DecodeIR.html
D       textfiles/IrpProtocols.html
        > moved to src/main/html/IrpProtocols.html
D       textfiles/RMPB_Readme.html
        > moved to src/main/html/RMPB_Readme.html
D       textfiles/Readme.html
        > moved to src/main/html/Readme.html
D       textfiles/Setup.vbs
        > moved to src/main/setup/Setup.vbs
D       textfiles/buildRef.txt
        > moved to src/main/resources/buildRef.txt
D       textfiles/irptransmogrifier.bat
        > moved to src/main/setup/irptransmogrifier.bat
D       textfiles/irptransmogrifier.sh
        > moved to src/main/setup/irptransmogrifier.sh
D       textfiles/protocols.ini
        > moved to src/main/resources/protocols.ini
D       textfiles/rmProtocols.xml
        > moved to src/main/resources/rmProtocols.xml
D       textfiles/rmaster.sh
        > moved to src/main/setup/rmaster.sh
D       textfiles/rmir.sh
        > moved to src/main/setup/rmir.sh
D       textfiles/setup.sh
        > moved to src/main/setup/setup.sh
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Sun Sep 13, 2020 1:10 pm    Post subject: Reply with quote

I don't agree with the extra files you have moved into src/main/resources, as these get added into RemoteMaster.jar in addition to being in the zip package. In particular, RMIR.sys which is over 6MB is in twice, once in the jar and again in the zip. Is this dellberate? Am I misunderstanding something?

There is also an issue of moving digitmaps.bin from the root. That is where UpdateDigitMapsBin creates it. I can look into modifying that, but I don't see a great reason for the move. Is there one?
_________________
Graham
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1186

PostPosted: Mon Sep 14, 2020 1:34 am    Post subject: Reply with quote

mathdon wrote:
I don't agree with the extra files you have moved into src/main/resources, as these get added into RemoteMaster.jar in addition to being in the zip package. In particular, RMIR.sys which is over 6MB is in twice, once in the jar and again in the zip. Is this dellberate? Am I misunderstanding something?

It was just an iterative suggestion, feel free to reject it or a subset thereof. It was certainly unintentional to pack stuff both in the jar and in the zip.

Quote:

There is also an issue of moving digitmaps.bin from the root. That is where UpdateDigitMapsBin creates it. I can look into modifying that, but I don't see a great reason for the move. Is there one?

There are two.

1. The location of the files is not compatible with the Maven standards (generated files go to the target subdirectory or a subdirectory thereof).
2. You use the exec-maven-plugin plugin to invoke UpdateDigitMapsBin, calling a command called "java". Although it probably works for you, this is a no-go. There is no guarantee that "java" in the shell path will invoke a java JVM, nor that it invokes the desired one.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Mon Sep 14, 2020 6:31 am    Post subject: Reply with quote

Barf wrote:
It was just an iterative suggestion, feel free to reject it or a subset thereof. It was certainly unintentional to pack stuff both in the jar and in the zip.

Then instead of putting these files in src/main/resources, I will create src/resources for them. If that re-use of the name resources also goes against some convention, let me know (and preferably suggest an alternative).

On digitmaps.bin, I will leave it as it currently is for the final build of v2.11 as will take some effort to work out how to handle it, and will sort it for the first of v2.12 (which will be 2.12.0).

Edit: Change of mind from using src/resources. I see that in IrScrutinizer you have protocols.ini in src/main/config, so I will also use src/main/config for the files concerned.
_________________
Graham
Back to top
View user's profile Send private message
Barf
Expert


Joined: 24 Oct 2008
Posts: 1186

PostPosted: Tue Sep 15, 2020 5:35 am    Post subject: Reply with quote

I don't like the "mvn validate" step, and the way third-party jars were handled, so I as a test revamped the libs directory to a Maven mini file local repository, available here. So now the "local" jars are instead "downloaded" from that mini repository. (The warnings about missing check sums can be ignored.)

I think it is a bit cleaner.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Barf
Expert


Joined: 24 Oct 2008
Posts: 1186

PostPosted: Tue Sep 15, 2020 5:39 am    Post subject: Reply with quote

If starting a virgin (without properties) RMIR still invokes the "find the RDFs/Images" dialogs. This is no longer meaningful, since they are always available as $APPHOME/RDF and $APPHOME/Images.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Tue Sep 15, 2020 8:42 am    Post subject: Reply with quote

Barf wrote:
If starting a virgin (without properties) RMIR still invokes the "find the RDFs/Images" dialogs. This is no longer meaningful, since they are always available as $APPHOME/RDF and $APPHOME/Images.

I don't understand. If you install RMIR by unzipping the installation package into an empty folder, there is no properties file when you first run it, but you do not get this dialog as the RDF and Images folders are in their default positions. If you run RMIR in place in the target folder, you DO get this dialog as those folders are not subfolders of target and so not in the default positions. I can find no information about APPHOME, do not know what it is, when and by what it is set or how to access it from RMIR if it exists. It does not appear to be an environment variable on my system.
_________________
Graham
Back to top
View user's profile Send private message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 3582
Location: Cambridge, UK

PostPosted: Tue Sep 15, 2020 11:32 am    Post subject: Reply with quote

Barf wrote:
I don't like the "mvn validate" step, and the way third-party jars were handled, so I as a test revamped the libs directory to a Maven mini file local repository, available here. So now the "local" jars are instead "downloaded" from that mini repository. (The warnings about missing check sums can be ignored.)

I think it is a bit cleaner.

I don't see the point of it. I didn't invent the idea of doing the local installs with validate, I got it from a web post about the use of maven-install-plugin, though I have lost track of where that is. As things stand, everything required to create the RMIR distro is in the km folder. The requirement to do mvn validate is the one prerequisite before packaging it. You would make that more complicated, perhaps more like ItrScrutinizer where there is a whole list of prerequisite actions. You may prefer that, I don't.
_________________
Graham
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Software All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central