Android Studio: how to remove/update the “Created by” comment added to all new classes?

后端 未结 9 1374
余生分开走
余生分开走 2020-12-07 07:53

By default Android Studio automatically adds a header comment to all new classes, e.g.

/**
 * Created by Dan on 11/20/13.
 */

Where is the

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 08:25

    Accepted answer had instructions for Android Studio v0.3. so I decide to add instructions for Android Studio 3.0.1

    • Go to Android Studio Preferences-> CopyRight->CopyRightProfiles and click on [+] to add a new profile or edit existing profile.

    • Create or update copyright template, a sample template can be copied from below:

    Creator: Hitesh Sahu on $today Last modified: $file.lastModified Copyright: All rights reserved Ⓒ $today.year http://hiteshsahu.com

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    • Now select that newly created copyright as your default copyright profile

    • Lastly update copyright of entire project like below

提交回复
热议问题