Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kB3X6-0005MQ-2k for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 22:04:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kB3X5-0005VI-2I for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 22:04:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kB3X4-0005VB-IM for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 22:04:38 +0000 Received: from anastigmatix.net ([68.171.219.55]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kB3X1-0005ch-K1 for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 22:04:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=iwqHa2bhQFkHYoZiKDvhXXpnGtuV+uVsTS4DhdGmXfM=; b=HuBA7b/Sc+sgjRl8Fo9rcef2d4 u/khlPNKbfmMw4P2f5ezZsC7pOT4wKVtQWOGCMo8YFAG6waVcM/7wxqEe+tF2W+s/l9LSp6InPIhP GUmrwnBOwF49HrheZcgcjS547Y/27fhFD/ee4uX+yvxJMR5jsN7+frWrIrqe8jn20E8C6ynVG0eot 7f7bZ6L/dPKqeQpiQDpZlQKRu+ErS93TOUohe75EdZQ68rjaDz2G+Zdlx7ysSn32e0e5O6he2boWi nc//eHOhtL2Ywsy5/art5pshVgafo44AXZqMY2aAXMfR5gDTSqgqtodPI1PM+P08bge0zlZu6jq7T rv4+U4ig==; Received: from [184.19.31.139] (port=51572) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1kB3Wy-00AjKs-Rn; Wed, 26 Aug 2020 18:04:33 -0400 Subject: Re: the ScriptingMojo To: Kartik Ohri References: <5F3D32E9.80504@anastigmatix.net> <5F3D36BE.70703@anastigmatix.net> <5F3D38F8.7050907@anastigmatix.net> <5F3D3A75.5010304@anastigmatix.net> <5F3D3D2E.4070109@anastigmatix.net> <5F3D43BD.4020900@anastigmatix.net> <5F3DA48D.7090408@anastigmatix.net> <5F41943D.9080707@anastigmatix.net> <5F427604.5010103@anastigmatix.net> <5F42A71F.8000002@anastigmatix.net> <5F459B6E.3020803@anastigmatix.net> <5F45EE7F.5020609@anastigmatix.net> <5F46B70E.6070601@anastigmatix.net> Cc: pljava-dev@lists.postgresql.org From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <5F46DC70.1080404@anastigmatix.net> Date: Wed, 26 Aug 2020 18:04:32 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <5F46B70E.6070601@anastigmatix.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-95.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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