{"action":"created","issue":{"url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin/issues/38","repository_url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin","labels_url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin/issues/38/comments","events_url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin/issues/38/events","html_url":"https://github.com/jaredsburrows/gradle-license-plugin/issues/38","id":308746116,"node_id":"MDU6SXNzdWUzMDg3NDYxMTY=","number":38,"title":"Empty report generated when a task depends on the LicenseReport task","user":{"login":"szugyi","id":3823933,"node_id":"MDQ6VXNlcjM4MjM5MzM=","avatar_url":"https://avatars2.githubusercontent.com/u/3823933?v=4","gravatar_id":"","url":"https://api.github.com/users/szugyi","html_url":"https://github.com/szugyi","followers_url":"https://api.github.com/users/szugyi/followers","following_url":"https://api.github.com/users/szugyi/following{/other_user}","gists_url":"https://api.github.com/users/szugyi/gists{/gist_id}","starred_url":"https://api.github.com/users/szugyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szugyi/subscriptions","organizations_url":"https://api.github.com/users/szugyi/orgs","repos_url":"https://api.github.com/users/szugyi/repos","events_url":"https://api.github.com/users/szugyi/events{/privacy}","received_events_url":"https://api.github.com/users/szugyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-03-26T21:43:13Z","updated_at":"2018-10-22T12:03:47Z","closed_at":null,"author_association":"NONE","body":"I have tried to generate reports every time the project is built, but in case I add the LicenseReport task to run before another task both the generated html and json files are empty.\r\nAs I can see in the discussion in issue #22 it should be possible since version 0.8.1.\r\n\r\nIf I run the task individually with `./gradlew licenseDebugReport` the generated files contain all the dependencies I have. However if I run the `./gradlew assembleDebug` I can see in the logs that the task was run, and it prints that the reports were generated, but they are empty.\r\n\r\n@MatthewTamlin Can you see what the problem might be with my configuration?\r\n\r\nlog:\r\n```\r\n$ ./gradlew assembleDebug\r\n\r\n> Task :app:licenseDebugReport\r\nWrote HTML report to /Users/szugyiczkicsaba/Downloads/MyApplication/app/build/reports/licenses/licenseDebugReport.html.\r\nWrote JSON report to /Users/szugyiczkicsaba/Downloads/MyApplication/app/build/reports/licenses/licenseDebugReport.json.\r\n\r\n\r\nBUILD SUCCESSFUL in 1s\r\n26 actionable tasks: 26 executed\r\n```\r\n\r\nMy configuration:\r\nProject level `build.gradle`\r\n```\r\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\r\nbuildscript {\r\n    \r\n    repositories {\r\n        google()\r\n        jcenter()\r\n    }\r\n    dependencies {\r\n        classpath 'com.android.tools.build:gradle:3.0.1'\r\n        classpath \"com.jaredsburrows:gradle-license-plugin:0.8.3\"\r\n    }\r\n}\r\n\r\nallprojects {\r\n    repositories {\r\n        google()\r\n        jcenter()\r\n    }\r\n}\r\n\r\ntask clean(type: Delete) {\r\n    delete rootProject.buildDir\r\n}\r\n```\r\n\r\nApp module `build.gradle`\r\n```\r\napply plugin: 'com.android.application'\r\napply plugin: \"com.jaredsburrows.license\"\r\n\r\nlicenseReport {\r\n    generateHtmlReport = true\r\n    generateJsonReport = true\r\n\r\n    // These options are ignored for Java projects\r\n    copyJsonReportToAssets = true\r\n}\r\n\r\nandroid.applicationVariants.all { variant ->\r\n    def variantCapitalized = variant.name.capitalize()\r\n\r\n    def assembleTask = tasks.getByName(\"assemble$variantCapitalized\")\r\n    def licenseTask = tasks.getByName(\"license${variantCapitalized}Report\")\r\n\r\n    assembleTask.dependsOn licenseTask\r\n}\r\n\r\nandroid {\r\n    compileSdkVersion 26\r\n    defaultConfig {\r\n        applicationId \"io.supercharge.myapplication\"\r\n        minSdkVersion 21\r\n        targetSdkVersion 26\r\n        versionCode 1\r\n        versionName \"1.0\"\r\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\r\n    }\r\n    buildTypes {\r\n        release {\r\n            minifyEnabled false\r\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\r\n        }\r\n    }\r\n}\r\n\r\ndependencies {\r\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\r\n    implementation 'com.android.support.constraint:constraint-layout:1.0.2'\r\n    implementation 'com.squareup.retrofit2:retrofit:2.4.0'\r\n    testImplementation 'junit:junit:4.12'\r\n    androidTestImplementation 'com.android.support.test:runner:1.0.1'\r\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'\r\n}\r\n```\r\noutput `open_source_licenses.html`\r\n```\r\n<html>\r\n  <head>\r\n    <style>body{font-family: sans-serif} pre{background-color: #eeeeee; padding: 1em; white-space: pre-wrap}</style>\r\n    <title>Open source licenses</title>\r\n  </head>\r\n  <body>\r\n    <h3>None</h3>\r\n  </body>\r\n</html>\r\n```\r\n\r\noutput `open_source_licenses.json`\r\n`[]`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin/issues/comments/431814861","html_url":"https://github.com/jaredsburrows/gradle-license-plugin/issues/38#issuecomment-431814861","issue_url":"https://api.github.com/repos/jaredsburrows/gradle-license-plugin/issues/38","id":431814861,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTgxNDg2MQ==","user":{"login":"hardysim","id":3737512,"node_id":"MDQ6VXNlcjM3Mzc1MTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3737512?v=4","gravatar_id":"","url":"https://api.github.com/users/hardysim","html_url":"https://github.com/hardysim","followers_url":"https://api.github.com/users/hardysim/followers","following_url":"https://api.github.com/users/hardysim/following{/other_user}","gists_url":"https://api.github.com/users/hardysim/gists{/gist_id}","starred_url":"https://api.github.com/users/hardysim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardysim/subscriptions","organizations_url":"https://api.github.com/users/hardysim/orgs","repos_url":"https://api.github.com/users/hardysim/repos","events_url":"https://api.github.com/users/hardysim/events{/privacy}","received_events_url":"https://api.github.com/users/hardysim/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T12:03:47Z","updated_at":"2018-10-22T12:03:47Z","author_association":"NONE","body":"For anyone still struggling with this:\r\n\r\nI've switched to https://developers.google.com/android/guides/opensource which works just fine.\r\n\r\n---\r\n\r\nHint:\r\nYou might want to add a theme to the activities of this library like so (e.g. when using a launcher theme or one without an actionbar):\r\n\r\n```xml\r\n<activity android:name=\"com.google.android.gms.oss.licenses.OssLicensesMenuActivity\"\r\n  android:theme=\"@style/Theme.MaterialComponents.Light.DarkActionBar\"/>\r\n\r\n<activity android:name=\"com.google.android.gms.oss.licenses.OssLicensesActivity\"\r\n  android:theme=\"@style/Theme.MaterialComponents.Light.DarkActionBar\"/>\r\n```"}}
{"actor":{"display_login":"hardysim"}}