{"action":"created","issue":{"url":"https://api.github.com/repos/cbeust/kobalt/issues/216","repository_url":"https://api.github.com/repos/cbeust/kobalt","labels_url":"https://api.github.com/repos/cbeust/kobalt/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/cbeust/kobalt/issues/216/comments","events_url":"https://api.github.com/repos/cbeust/kobalt/issues/216/events","html_url":"https://github.com/cbeust/kobalt/issues/216","id":157616999,"number":216,"title":"`src/test/java` sometimes compiled in the `compile` task","user":{"login":"DevCharly","id":5604048,"avatar_url":"https://avatars.githubusercontent.com/u/5604048?v=3","gravatar_id":"","url":"https://api.github.com/users/DevCharly","html_url":"https://github.com/DevCharly","followers_url":"https://api.github.com/users/DevCharly/followers","following_url":"https://api.github.com/users/DevCharly/following{/other_user}","gists_url":"https://api.github.com/users/DevCharly/gists{/gist_id}","starred_url":"https://api.github.com/users/DevCharly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevCharly/subscriptions","organizations_url":"https://api.github.com/users/DevCharly/orgs","repos_url":"https://api.github.com/users/DevCharly/repos","events_url":"https://api.github.com/users/DevCharly/events{/privacy}","received_events_url":"https://api.github.com/users/DevCharly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-05-31T08:31:31Z","updated_at":"2016-06-02T16:57:11Z","closed_at":null,"body":"Ok, this one is strange. Have some projects with tests (`src/test/java` folders) and Kobalt compiles them in the `compile` task (with errors; that's why I discovered it).\r\n\r\nTook me some time until I found out (in the debugger) that varying source directories are the reason. Usually have only \"src\", but sometimes \"src/main/java\".\r\n\r\nSome info to reproduce the issue:\r\n\r\nBuild.kt:\r\n```\r\nval p1 = project {\r\n\tname = \"p1\"\r\n\tdirectory = name\r\n\tsourceDirectories = hashSetOf( \"src\" )\r\n}\r\n\r\nval p2 = project(p1) {\r\n\tname = \"p2\"\r\n\tdirectory = name\r\n}\r\n```\r\n\r\nFiles:\r\n```\r\np1/src/p1.java\r\np2/src/main/java/p2.java\r\np2/src/test/java/p2test.java\r\n```\r\n\r\nThe resulting javac command line, which includes p2test.java:\r\n`javac -d p2\\kobaltBuild\\classes -classpath D:\\Projects\\kobalt-sandbox\\p2\\kobaltBuild\\classes;p1\\kobaltBuild\\classes p2\\src\\main\\java\\p2.java p2\\src\\test\\java\\p2test.java`\r\n\r\nI had a breakpoint at JvmCompilerPlugin.createCompilerActionInfo() and found out that the parameter sourceDirectories contains `[src]` when first invoked for p1, but on second call for p2 it is `[src, src\\main\\java, src\\main\\java]`. `src` should be not there for p2 because files.findRecursively() then searches `p2/src` and finds p2test.java\r\n"},"comment":{"url":"https://api.github.com/repos/cbeust/kobalt/issues/comments/223354087","html_url":"https://github.com/cbeust/kobalt/issues/216#issuecomment-223354087","issue_url":"https://api.github.com/repos/cbeust/kobalt/issues/216","id":223354087,"user":{"login":"cbeust","id":92322,"avatar_url":"https://avatars.githubusercontent.com/u/92322?v=3","gravatar_id":"","url":"https://api.github.com/users/cbeust","html_url":"https://github.com/cbeust","followers_url":"https://api.github.com/users/cbeust/followers","following_url":"https://api.github.com/users/cbeust/following{/other_user}","gists_url":"https://api.github.com/users/cbeust/gists{/gist_id}","starred_url":"https://api.github.com/users/cbeust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbeust/subscriptions","organizations_url":"https://api.github.com/users/cbeust/orgs","repos_url":"https://api.github.com/users/cbeust/repos","events_url":"https://api.github.com/users/cbeust/events{/privacy}","received_events_url":"https://api.github.com/users/cbeust/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T16:57:11Z","updated_at":"2016-06-02T16:57:11Z","body":"But it's not doing that, it's only using directories under `p2` to compile the project \"p2\":\r\n\r\n```\r\njavac -d p2/kobaltBuild/classes -classpath p1/kobaltBuild/classes p2/src/main/java/p2.java p2/src/test/java/p2test.javap2/src/test/java/p2test.java:4: error: <identifier> expected\r\nasdfasdfsadf\r\n            ^\r\np2/src/test/java/p2test.java:5: error: reached end of file while parsing\r\n\r\n```\r\n"}}
{"actor":{"display_login":"cbeust"}}