Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an easy way to have the copyright notice automatically added by android studio?

I have just started learning android and using the Android Studio by IntelliJ, so please bear with me if this is a very stupid question to ask.

Is there a way to have copyright notice text automatically added to source code files, by android studio IDE?

I have eclipse setup to automatically add copyright notice text at the top of my source code file, whenever it is created. So, I am expecting something similar for android studio as well.

Please note: I know that I can easily do it by write a script that can add a license text, so please don't suggest that as an answer.

Thanks for reading this question.

like image 864
Moni Avatar asked Jan 11 '15 01:01

Moni


People also ask

How do you add copyright to a file?

Insert copyright text into files To insert the text into a single file, open it in the editor, press Alt+Insert , and select Copyright from the popup. To insert the text into a group of files, right-click a node in the Project tool window, and select Update Copyright.

How do you add a copyright to a class in Java?

3.2. We first navigate to Preferences -> General -> Copyright. Then, to add a new copyright header, we click on the Add button. To modify an existing license, we select a license from the Licenses and then click on the Modify button.


1 Answers

In Preferences --> Copyright --> Copyright Profiles, create a profile, and replace the default text with your own custom copyright notice. You can then format it in Formatting tab.

Example: enter image description here

Then in Copyright tab, select your profile (in my example "test"), and copyright text will be added to new source files you create.

enter image description here

To add/update the copyright to existing project files, select Code -> Update Copyright from the menu bar and select the scope of files that should be updated.

like image 68
Melquiades Avatar answered Oct 11 '22 13:10

Melquiades