public inbox for [email protected]
help / color / mirror / Atom feedFrom: Chapman Flack <[email protected]>
To: Kartik Ohri <[email protected]>
Cc: [email protected]
Subject: Re: PL/Java new build plugin
Date: Tue, 7 Jul 2020 18:42:45 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAASLQ4PwL2U6t0DYZK4KF9+2UZT56Npcga4xZWWfo04w2QZxCQ@mail.gmail.com>
References: <CAASLQ4Mva7dAXiS_c9OLhV4VzNHF=XNKJosuS5gtZTB6b4TW1Q@mail.gmail.com>
<[email protected]>
<CAASLQ4NvfJz8VQQFU8mKkY4RabiVQesxdbkudk5Cf24Tm9BixQ@mail.gmail.com>
<[email protected]>
<CAASLQ4M3+XNBYiHMg32X6poY25eMbvMC5MHbA48pt30QK8nAww@mail.gmail.com>
<[email protected]>
<CAASLQ4PtGSS-OP9k_740EBdyT1bVmDi1PUndn1ZNWzyJDRQkMA@mail.gmail.com>
<[email protected]>
<CAASLQ4NXzEttesB48wxD_wvR5_rNDvXZkKCmNELn247+W_vrMw@mail.gmail.com>
<[email protected]>
<CAASLQ4NTYp42EY1=nnKPRAr6VV-KpQ=hueQn-jHZsEebp4cAaQ@mail.gmail.com>
<[email protected]>
<CAASLQ4OCh2ybECbfJQ5UgSo4r-UxRcmPPhqjrGpEZ=ZPdURNMg@mail.gmail.com>
<[email protected]>
<CAASLQ4MWn3BjiZpijXEjd3sYaeuQnFffafZYe9XWnV8PPXv1nQ@mail.gmail.com>
<[email protected]>
<CAASLQ4NOq2FcTvp1hB-kTnJZgxfRP=u20gfQT=tgpvBq+9Ac-w@mail.gmail.com>
<CAASLQ4PwL2U6t0DYZK4KF9+2UZT56Npcga4xZWWfo04w2QZxCQ@mail.gmail.com>
On 07/07/20 09:58, Kartik Ohri wrote:
> pgsql.properties has paths of the type C\:/PROGRA~1/POSTGR~1/12/bin while
> the our plugin has paths of type C:/PROGRA~1/POSTGR~1/12/bin. I can
> probably fix this by detecting the OS and doing a string substitution
I'm not sure that's really a Windows-specific behavior, just an
overcautious \ added before the : when the property is written to the file.
If you were using java.util.Properties and the store() method to write
the file, you also would have the \ there:
jshell> var p = new Properties()
jshell> p.put("mypath", "C:/PROGRA~1/POSTGR~1/12/bin")
jshell> p.store(System.out, "I am a comment")
#I am a comment
#Tue Jul 07 18:32:12 EDT 2020
mypath=C\:/PROGRA~1/POSTGR~1/12/bin
The backslash isn't actually necessary before a colon as part of the value.
(If a colon were part of the /key/, the backslash would be needed.)
A Properties object can happily read in the same value with or without the
backslash there:
jshell> p.clear()
jshell> p.load(new StringReader("""
...> #Tue Jul 07 18:32:12 EDT 2020
...> mypath=C:/PROGRA~1/POSTGR~1/12/bin
...> """))
jshell> p.get("mypath")
$12 ==> "C:/PROGRA~1/POSTGR~1/12/bin"
So that backslash isn't really essential there, it is just something
Properties.store() happens to add when writing a file.
So I have to assume that whatever isn't working on Windows must have
some other cause really.
It might not be worth spending much time on backslash or no backslash
in the file, as I assume eventually you will write no file at all, and
just set the properties in Maven directly.
I added some additional code comments in github:
https://github.com/amCap1712/pljava/commit/f3dd925
Regards,
-Chap
view thread (132+ 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: PL/Java new build plugin
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