android studio 版权,Android studio/IntelliJ IDEA 管理版权声明Copyright Profiles

我们经常看到成熟的开源项目在每个文件都有完整的版权声明信息,通常以Copyright (c) 开通的注释,今天就来介绍如何在Android studio/IntelliJ IDEA 中管理这些版权信息

编辑copyright

Ctrl+Alt+a打开搜索输入Copyright 打开File -> Settings -> Editor -> Copyright -> Copyright Profiles

在这里可以创建版权信息档案,每个档案都有一个名字,例如Apache 2.0或者GNU,便于以后使用。

模板中可用变量NameTypeComment$todayDateInfoThe current date and time.

$file.fileNameStringThe name of the currently opened file where the notice is to be generated.

$file.pathNameStringThe complete path and name of the currently opened file where the notice is to be generated.

$file.classNameStringThe name of the currently opened Java file where the notice is to be generated.

$file.qualifiedClassNameStringThe fully qualified name of the currently opened file where the notice is to be generated.

$file.lastModifiedDateInfoThe date and time when the current file was last changed.

$project.nameStringThe name of the current project.

$module.nameStringThe name of the current module.

$usernameStringThe name of the current user.

DateInfo 对象包含以下属性yearintThe current year.

monthintThe current month (1-12).

dayintThe current date of month (1-31).

hourintThe current hour (0-11).

hour24intThe current hour (0-23).

minuteintThe current minute of the hour (0-59).

secondintThe current second of the minute (0-59).

例如Apache 2.0Copyright $today.year xxxx

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.

GNU gpl v3Copyright (C) $today.year xxxxx

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.

You should have received a copy of the GNU General Public License

along with this program. If not, see .

使用copyright使用默认copyright

在File -> Settings -> Editor -> Copyright 中可以设置默认的版权信息,点击加号scope选择Project Files 可以设置当前项目默认版权信息。

在当前文件插入copyright

Ctrl+Alt+a 搜索copyright选择copyright

整个项目更新copyright

Ctrl+Alt+a 搜索copyright选择update copyright

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值