Closed tiwanari closed 8 years ago
We can update the license.html
by using scripts/update_licenses.sh
.
At this time, the app shows the following dialog when you click the menu Copyright Notice
.
I know this is very ugly and it contains some meaningless rows (no licensed). I will create a mechanism to format the file in a good style with the script. I'm using a plugin to collect licenses I referred in #40.
NOTE: The plugin fails to collect licenses of some libraries such as https://github.com/rejasupotaro/kvs-schema. I'm not sure why (maybe, the LICENSE file should not have any extension?).
And I found this PR causes an error in Travis because of some tasks introduced by the plugin. Anyway, this PR is WIP.
Please give this some comments. What do you think about this way to update and show copyrights?
I don't know but I don't think the copyright notices have to have pretty appearance.
(you'll find, for instance, inbox has very ugly simple copyright notices)
Also I can't understand why you introduced the simple shell script. Does it have any advantages against grande scripts? or you couldn't do something in gradle?
Oh, I think it's better to use gradle :) I'm not so familiar with making gradle scripts but I'll try. Thanks for your comment.
I'm thinking of making a placeholder of copyright such as https://gist.github.com/cyrilmottier/4124374, and generating a html by inserting the libraries' information collected by a plugin. My first idea to do that was making a simple Ruby script because it's easy and there is no other reason at present.
I changed my mind to use another plugin to make licenses.html
and the plugin generates the HTML semi-automatically.
Firstly, run
# ./gradlew checkLicenses
and you'll see some lists of licenses we use if they are lack in app/licenses.yml
. The list is somewhat incomplete because some elements are not filled. So, you should gather the lacked information from their pages and fill it. Then, run
# ./gradlew generateLicensePage
If there is no error, you can get app/src/main/assets/licenses.html
While I decided to use the another plugin for others' libraries, I keep the original one for our license. Because it can maintain all the license headers of source files with a command.
Keep LICENSE
file in the root directory that should be placed in the headers of source files.
Run
# ./gradlew licenseFormat
and this will format all the files.
If you want to know all the files follow the LICENSE
file, run
# ./gradlew license
and this will be executed automatically while building our app.
I'm not sure why it happens but *Test.java
violates the license...
See the build error;
> License violations were found: /home/travis/build/PileProject/drive/app/src/androidTest/java/com/pileproject/drive/execution/NxtControllerTest.java,/home/travis/build/PileProject/drive/app/src/androidTest/java/com/pileproject/drive/execution/BlockProgramLogicTest.java,/home/travis/build/PileProject/drive/app/src/androidTest/java/com/pileproject/drive/programming/visual/block/NumberTextViewDelegateTest.java,/home/travis/build/PileProject/drive/app/src/androidTest/java/com/pileproject/drive/util/development/UnitTest.java,/home/travis/build/PileProject/drive/app/src/androidTest/java/com/pileproject/drive/comm/BluetoothCommunicatorTest.java,/home/travis/build/PileProject/drive/app/src/androidTest/java/com/pileproject/drive/ApplicationTest.java}
To avoid this, I set exclude
for *Test.java
.
license {
include "**/*.java"
exclude "**/*Test.java"
}
And now, you can see the others' license like this;
(It is better than inbox's one, isn't it? :P )
Since the license checks of new plugins will be executed automatically, I had to fix the license headers of files and they may be annoying when you review this PR. I'm sorry for that.
Ah... one more thing. I had to fix .travis.yml
because it became to always fail. I specified a supported android sdk version in it.
Hey @myusak,
Please review this PR. Thank you in advance.
This PR solves #40.
This PR introduces ;
licenses.html
)licenses.html
easily