Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9C0CC200CA3 for ; Thu, 1 Jun 2017 20:51:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9AB60160BDF; Thu, 1 Jun 2017 18:51:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8E75F160BC1 for ; Thu, 1 Jun 2017 20:51:58 +0200 (CEST) Received: (qmail 36993 invoked by uid 500); 1 Jun 2017 18:51:57 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 36979 invoked by uid 99); 1 Jun 2017 18:51:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2017 18:51:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 07A25C052F for ; Thu, 1 Jun 2017 18:51:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.917 X-Spam-Level: * X-Spam-Status: No, score=1.917 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qtsjfK8c1tQu for ; Thu, 1 Jun 2017 18:51:54 +0000 (UTC) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 1C23E5F23E for ; Thu, 1 Jun 2017 18:51:54 +0000 (UTC) Received: by mail-io0-f179.google.com with SMTP id f102so41844110ioi.2 for ; Thu, 01 Jun 2017 11:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ebSAXXe20k7mAqtpVLnlEfbLbnPybSN2BBkZRJ7F75Y=; b=dC8GAAHq7eTREhUOeWtS4m8ru2slYdqonL/00ocX7t5QzuffjV7WWoGMJ+DJ7SaXib RIj2ICsqvK94nnLzMNAp9mZetqQH3wLrlYm5H3n1Ixhkmm5KwUmbq/ZKe71x6noVkPGb EbC5MRrDEk4FOlPxvCqltW+FSVGaxKBIRVpv4XlVrkArgz068P+o8eky72wafOc6Iopg YOGZBGMms45YKxpkLRRbBYauiNTYhpk96rhOJQl+eEwefuGykQOfzfFGeWpDgDgJGGDM r5DG2MgOYH9mi+T4BYgKuYhywdYkaF+humCop2nvruy1KvUTi9cEz1j4eS4qFKxhJ5mZ +nuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ebSAXXe20k7mAqtpVLnlEfbLbnPybSN2BBkZRJ7F75Y=; b=VMrNltNk3EgAyvkdu5RI9QksR0t2Xw6q1HIAYOJxrSCrhW5omYCK34h+4RdHr6bTCL SRewwT4R9ldEcRS1BMwC9W7AuY9JqQupDz6Ki+59ZP/kzzHc2heH/owH4EAUqaKOPFaq PXzv4Y3+5rPHlsEkqTkN8zSgE+p1yQLFn9Z4LUMbsRUmP/n0G135+S3aSsYnUL5TrNM1 fURHrttUPMrskK1Q159z5JbBbkLYncraaNFgOFvcYnnLAz3QUO8ZFrtwlJq/RS/ay9xG Kk8Ts/cAhL3Rnh8z4zulVkHYGVhROaDrZUhcleDqtVdSYNXZ7NfvSLwDUcFoAm6RY2MG g+fA== X-Gm-Message-State: AODbwcBMs+KOrih+jTUNVI629kE8tcOcFXvHz+jRsBcCD7EmgXjxNJ8V YWBZhqIPJB+RLIuoQbrOttDipqYi+fsI X-Received: by 10.107.146.134 with SMTP id u128mr4509909iod.154.1496343112980; Thu, 01 Jun 2017 11:51:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.127.85 with HTTP; Thu, 1 Jun 2017 11:51:12 -0700 (PDT) In-Reply-To: References: <1496317757242-61991.post@n4.nabble.com> <1496325067791-61994.post@n4.nabble.com> <1496327404126-61997.post@n4.nabble.com> From: Josh Tynjala Date: Thu, 1 Jun 2017 11:51:12 -0700 Message-ID: Subject: Re: [FlexJS] Why FlexJS compiler statically looks for 'src' folder To: dev@flex.apache.org Content-Type: multipart/alternative; boundary="94eb2c055bfab6215f0550ea8785" archived-at: Thu, 01 Jun 2017 18:51:59 -0000 --94eb2c055bfab6215f0550ea8785 Content-Type: text/plain; charset="UTF-8" If there are other nested source directory structures recommended as standard practice by opinionated tools, similar to how Maven use "src/main/flex", then sure, let's add them as we become aware of them. "srcx/main/flex" would indeed not be solved by my recommended change. However, "source", "srcx", or "whatever-i-want-to-call-it" would all be solved, and I think a single directory with a different name than "src" is vastly more common than another nested directory structure like "srcx/main/flex". At least from my experience looking at real world projects over the years. Let's not let perfection stop us from making an improvement that will reduce the time users spend on figuring out why something isn't working as expected and contributors spend explaining why "src" is a special case when it doesn't need to be. - Josh On Thu, Jun 1, 2017 at 11:11 AM, Alex Harui wrote: > If we allow one exception, why not more than one? > > What if we add an "outputFolderExceptions" list and default it to just > contain "src/main/flex". Then I could add "src" in my SDK installs to get > what I want. Still not sure how it solves the original problem though. > If someone has a src/main/flex pattern and changes it to srcx/main/flex > seems like they will still be surprised. > > -Alex > > On 6/1/17, 10:39 AM, "Josh Tynjala" wrote: > > >If we do as I suggest, there would no longer be a list of patterns. I want > >to allow *any* folder name. That's what I mean by generalizing. Just > >automatically put the "bin" directory relative to the parent directory of > >the main source file. (with one exception: Maven-style project structures > >with src/main/flex would still be a special case). > > > >Right now, if you compile like this... > > > >mxmlc src/MyProject.mxml > > > >...you get a "bin" directory in the same parent directory as "src". > > > >I want to allow you to use ANY name instead of "src" too, like this: > > > >mxmlc source/MyProject.mxml > >mxmlc whatever-i-want-to-call-it/MyProject.mxml > > > >... and still get a "bin" directory relative to "source" or > >"whatever-i-want-to-call-it". Replace "source" or > >"whatever-i-want-to-call-it" with *any* folder name at random, and I want > >it to just work. > > > >The compiler would do something similar to this pseudo-code: > > > >File mainClass = new > >File("/path/to/MyProject/whatever-i-want-to-call-it/MyProject.mxml"); > >File bin = mainClass.getParent().getParent().resolve("bin"); > > > >You'd get /path/to/MyProject/bin/ > > > >- Josh > > > > > >On Thu, Jun 1, 2017 at 10:18 AM, Alex Harui > >wrote: > > > >> I just want to optimize for a couple of common cases in order to save me > >> and maybe other folks some time. If for some reason I need to compile a > >> Flash Builder project from the command-line or Ant or Java debugger, I > >> don't have to remember to set the -output parameter. > >> > >> I used to get FB projects in JIRA and email and then unpack them and > >> compile them outside of FB because then I can get the debugger on them > >> more easily. All of our examples are set up so you can compile them > >>from > >> the command line and not have to type the -output parameter. And if you > >> make a mistake typing the output folder name, it ends up creating a new > >> folder with that name. > >> > >> I'm not sure what you mean by generalizing. Are you suggesting allowing > >> folks to add more patterns to the set of folders where the compiler will > >> chose the parent of the folder pattern? I'm not sure how that solves > >>the > >> problem. Seems like you'd still be surprised if you use "source" or > >> something that isn't in the default list so a warning would still help, > >> but if that's what you want to do, seems like it wouldn't hurt. > >> > >> My 2 cents, > >> -Alex > >> > >> > >> On 6/1/17, 9:59 AM, "Josh Tynjala" wrote: > >> > >> >I'm not sure that I understand why you mentioned changing Flash > >>Builder's > >> >default source path. That seems mostly tangential here. > >> > > >> >I'm saying that the compiler shouldn't care whether it's named "src", > >> >"source", or "whatever-i-want-to-call-it". It should simply default to > >> >putting "bin" in the parent of that folder. A warning might be a good > >> >temporary workaround, but generalizing this behavior is significantly > >> >better, in my opinion. > >> > > >> >- Josh > >> > > >> >On Thu, Jun 1, 2017 at 9:26 AM, Alex Harui > >> >wrote: > >> > > >> >> I think "src" is for Flash Builder. I don't know what it would take > >>to > >> >> get FB to default to something else. I know I have lots of projects > >> >>with > >> >> just a "src" folder. > >> >> > >> >> I agree it is confusing. We could output a warning or error if you > >> >> haven't specified -output, -js-output and don't have "src" or > >> >> "src/main/flex" folders. Something like "Warning: output folder not > >> >> specified and src or src/main/flex folders not specified. Output > >>will > >> >>be > >> >> in >> >> > >> >> Would that help eliminate confusion? That's easy for someone to add > >>to > >> >> MXMLFlexJSPublisher.java. > >> >> > >> >> Thoughts? > >> >> -Alex > >> >> > >> >> On 6/1/17, 8:52 AM, "Josh Tynjala" wrote: > >> >> > >> >> >I think I had some trouble trying to get -output to accept a > >>directory > >> >>for > >> >> >a JS-only project, and that's when I figured out that -js-output > >> >>exists. > >> >> >Maybe I was doing something wrong at the time. Or maybe it didn't > >>quite > >> >> >work properly yet. > >> >> > > >> >> >Although, I still think it's confusing to those who don't realize > >>that > >> >> >"src" and "src/main/flex" get special treatment and then "bin" ends > >>up > >> >> >somewhere else if they happen to choose a different name for a new > >> >> >project. > >> >> >Between me and Santanu, that's two people who had to waste time on > >> >> >figuring > >> >> >out why "bin" ended up somewhere we didn't expect. I could live > >> >>without it > >> >> >being the current working directory if "bin" would simply go into > >>the > >> >> >parent directory of the directory containing the main class by > >>default, > >> >> >regardless of whether it's named "src" or not. If "src/main/flex" is > >> >>the > >> >> >only special case, that's better, in my opinion. > >> >> > > >> >> >- Josh > >> >> > > >> >> >On Thu, Jun 1, 2017 at 8:16 AM, Alex Harui > >> > >> >> >wrote: > >> >> > > >> >> >> And if you just use -output and not -js-output the bin folder > >>will be > >> >> >> where you specified -output, and if you specify > >> >> >> -output=somefolder\somefile.swf the output will be in > >> somefolder\bin. > >> >> >> > >> >> >> The logic is trying to say: > >> >> >> 1) If you specify -output as a SWF, we will use the parent folder > >>of > >> >>the > >> >> >> SWF > >> >> >> 2) If you specify -output as a folder, we will use that folder > >> >> >> 3) If you specify -js-output, we will use that regardless of what > >>you > >> >> >>used > >> >> >> for -output > >> >> >> 4) If you didn't specify -output or -js-output then > >> >> >> A) If you have a src folder or src/main/flex folder we will use > >>the > >> >> >> parent of src > >> >> >> B) Otherwise we will use the parent folder of the main source > >>file. > >> >> >> > >> >> >> I don't agree that CWD is the right default. For me, I've always > >> >>had a > >> >> >> folder full of test cases and am not always changing folders. I > >> >>think > >> >> >>the > >> >> >> regular Flex MXMLC worked this way as well so I didn't want to > >>change > >> >> >>that > >> >> >> pattern. > >> >> >> > >> >> >> 4A is just a convenience for those who follow certain common > >> >>patterns so > >> >> >> they don't have to do as much typing on the command line. It > >>might > >> >>also > >> >> >> "do the right thing" for Flash Builder users. I think Maven > >>always > >> >> >> specifies the output folder. > >> >> >> > >> >> >> My 2 cents, > >> >> >> -Alex > >> >> >> > >> >> >> On 6/1/17, 7:48 AM, "Josh Tynjala" wrote: > >> >> >> > >> >> >> >In that case, the SWF will use the -output option: > >> >> >> > > >> >> >> >mxmlc -output=path/to/MyProject.swf -js-output=. > >>source/MyProject.as > >> >> >> > > >> >> >> >- Josh > >> >> >> > > >> >> >> >On Thu, Jun 1, 2017 at 7:30 AM, piotrz > >> > >> >> >>wrote: > >> >> >> > > >> >> >> >> Ahh..Ok now it is clear. What about if we have > >> >> >> >> -compiler.targets=JSFLEX,SWF - > >> >> >> >> So -js-output will be also the place where SWF file will > >>landed? > >> >>- If > >> >> >> >>yes > >> >> >> >> in > >> >> >> >> that case this param could have different name. > >> >> >> >> > >> >> >> >> Thanks, > >> >> >> >> Piotr > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> ----- > >> >> >> >> Apache Flex PMC > >> >> >> >> piotrzarzycki21@gmail.com > >> >> >> >> -- > >> >> >> >> View this message in context: http://apache-flex- > >> >> >> >> development.2333347.n4.nabble.com/FlexJS-Why-FlexJS- > >> >> >> >> compiler-statically-looks-for-src-folder-tp61991p61997.html > >> >> >> >> Sent from the Apache Flex Development mailing list archive at > >> >> >> >>Nabble.com. > >> >> >> >> > >> >> >> > >> >> >> > >> >> > >> >> > >> > >> > > --94eb2c055bfab6215f0550ea8785--