ninetwozero / gradle-to-js

A quick & dirty Gradle build file to JavaScript object parser
Apache License 2.0
47 stars 21 forks source link

Unable to parse dependency strings with no space #32

Open friederbluemle opened 2 years ago

friederbluemle commented 2 years ago

The following is valid syntax that does not get parsed correctly:

dependencies {
    implementation("org.example:name1:1.0.0")
    implementation("org.example:name2:1.0.0")
}

Result:

{
  "dependencies": [
    {
      "excludes": []
      "group": "org.example"
      "name": "name1"
      "type": "implementation"
      "version": "1.0.0"
    }
  ]
}

The problem appears to be in the parseSpecialClosure function: If there is no space after implementation, it will move the whole line into currentKey, until it hits the newline character - Then it will take the next line into currentValue. This appears to be closely related to #29 (which is about the plugins block) - An eventual fix will likely close both issues at the same time.