public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chapman Flack <[email protected]>
To: Kartik Ohri <[email protected]>
Cc: [email protected]
Subject: Re: the ScriptingMojo
Date: Wed, 26 Aug 2020 18:04:32 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAASLQ4Mva7dAXiS_c9OLhV4VzNHF=XNKJosuS5gtZTB6b4TW1Q@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAASLQ4MBWQeFLdAPNcsgcpLyekU5X=ExQUuGgE49AUFdEYJr8g@mail.gmail.com>
	<[email protected]>
	<CAASLQ4P5oEx0DLoDLEOAkZSwffU2eS2+NKbevgYqpknHGucaTw@mail.gmail.com>
	<[email protected]>
	<CAASLQ4Nr3MPQuZziVU+89ULZ=BgQjaPPnCLsyPR3mhW-eWoOBw@mail.gmail.com>
	<[email protected]>
	<CAASLQ4PkP017rtyUswKO_TCiNmnica-nrQHBgggFw-U_9MstUg@mail.gmail.com>
	<[email protected]>
	<CAASLQ4P47TNiEsuj3ga-vuYeCSBJZmHrPM-49E-X=0T5RTmhKw@mail.gmail.com>
	<[email protected]>
	<CAASLQ4MH5JaVbrG9O_S+9dnp=tj_8N3jArxxpf-dJD1ezd5SfQ@mail.gmail.com>
	<[email protected]>

On 08/26/20 15:25, Chapman Flack wrote:

> If the nar-maven-plugin is also generating such files when it uses MSVC
> to build, then probably it also has some classes to help generating those
> files (or it uses a dependency that has some classes to help generating
> those files). It might not be too bad to end up adding that as a dependency
> of the PGXS plugin (added by a profile conditioned on Windows os) in order
> to reuse that part of its code, if it is accessible.

That stuff seems to be here, and accessible:

https://maven-nar.github.io/apidocs/com/github/maven_nar/cpptasks/ide/ProjectWriter.html

... but I have never really watched the nar-maven-plugin closely enough
on Windows to see if it even creates such a file for pljava, or just passes
everything on the command line. I don't know enough about MSVC to know if
the project file is mandatory.

In your commit cb0ceb9 I see that maybe you could get by with only the
command line.

Of course I would handle the /DNDEBUG, /DWindows, /DWIN32, and
/DPLJAVA_SO_VERSION=1.6.0-SNAPSHOT by defines.add (without the /D)
and overriding formatDefines to supply /D rather than -D. And really,
the PLJAVA_SO_VERSION=project.version should be among the base defines
supplied to any template.

I would rather have the probing be done in the probe method; it could
just have an OS name parameter and return a boolean.

"Windows-MinGW-w64" : {
  probe : function(os) {
   return os.startsWith('Windows') && System.gete...GW64");

"Windows-MSVC" : {
  probe : function(os) {
   return os.startsWith('Windows') && System.gete...VCINSTALLDIR");

or something like that, where the outer container of the templates would
be a [ ] rather than a { } so there would be a reliable order for probing
the templates. The driving code could just go down the list calling
probe(os) until one returned true, and use that one.

Regards,
-Chap





view thread (78+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: the ScriptingMojo
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox