Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing .gradle file #13

Open
apetesh opened this issue Apr 18, 2018 · 9 comments
Open

Error parsing .gradle file #13

apetesh opened this issue Apr 18, 2018 · 9 comments
Labels

Comments

@apetesh
Copy link

apetesh commented Apr 18, 2018

Hi,

Parsing a .build file containing the following text:

def coverageTaskAndroidJob = task("coverageTaskAndroidJob",
        dependsOn: ':android-job:createCovAndroidTestCoverageReport') {

    def dep1 = tasks.getByPath(':android-job:clean')

    def target = tasks.getByPath(':android-job:createCovAndroidTestCoverageReport')

    target.dependsOn dep1
    group = "Coverage"
    description 'Runs coverage for android-job'
}

def coverageTaskVolley = task("coverageTaskVolley",
        dependsOn: ':volley:createCovCoverageReport') {

    def dep1 = tasks.getByPath(':volley:clean')
    def dep2 = tasks.getByPath(':volley:testCovUnitTest')

    def target = tasks.getByPath(':volley:createCovCoverageReport')

    target.dependsOn dep1
    target.dependsOn dep2
    group = "Coverage"
    description 'Runs coverage for volley'
}

causes the following error:

TypeError: Cannot assign to read only property '0' of object '[object String]'
    at assignKey (<project>/node_modules/deep-assign/index.js:28:13)
    at assign (<project>/node_modules/deep-assign/index.js:43:7)
    at assignKey (<project>/node_modules/deep-assign/index.js:30:15)
    at assign (<project>/node_modules/deep-assign/index.js:43:7)
    at deepAssign (<project>/node_modules/deep-assign/index.js:64:5)
    at deepParse (<project>/node_modules/gradle-to-js/lib/parser.js:160:29)
    at Readable.<anonymous> (<project>/node_modules/gradle-to-js/lib/parser.js:623:13)
    at Readable.emit (events.js:160:13)
    at Readable.read (_stream_readable.js:482:10)
    at flow (_stream_readable.js:853:34)
    at emitReadable_ (_stream_readable.js:521:3)
    at process._tickCallback (internal/process/next_tick.js:152:19)
@karllindmark
Copy link
Contributor

karllindmark commented Apr 18, 2018 via email

@apetesh
Copy link
Author

apetesh commented Apr 18, 2018

Hi Karl,

The expected result should be:

  1. The object representation of the blocks
  2. Not crashing when parsing a file which contains this chunk of text.

Thanks for the quick reply!

@matthiasthomas
Copy link

Hey guys,

I went through the same issue today. I can privately send you the culprit file if you need. I'm also going to investigate on my side, I'll keep you updated.

@karllindmark
Copy link
Contributor

karllindmark commented Apr 19, 2018 via email

@karllindmark
Copy link
Contributor

@apetesh: Could you provide me with a snippet with the expected result? I'm setting up a test case here locally and would like your input on it. :-)

@matthiasthomas
Copy link

Hi @karllindmark ! Here's the file!
I didn't really have time to look into it, but deep-assign is deprecated and seems to be the issue so it might be a good idea to switch to merge-options or some other module.

Thanks,

mat.zip

@karllindmark
Copy link
Contributor

karllindmark commented Apr 23, 2018 via email

karllindmark pushed a commit that referenced this issue Apr 23, 2018
Not really sure what to call them though.

Closes #13
@karllindmark
Copy link
Contributor

Hey guys! So, I have a possible solution for this issue in #14 - would you care to take a look? @apetesh @matthiasthomas 🤝

@dilipkumar2k6
Copy link

I tested for this issue 13 by using branch feature/add-support-for-multiline-closures but this issue still persist. I still see same issue.

karllindmark pushed a commit that referenced this issue Aug 29, 2018
Not really sure what to call them though.

Closes #13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants