“Groovy”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
→‎map
 
(未显示同一用户的16个中间版本)
第1行: 第1行:
[[category:ops]]  
+
[[category:ops]] [[category:devops]]  
=ins=
+
=install=
 
  sudo apt install  groovy groovy-doc  #Groovy Version: 2.4.21 JVM: 11.0.8 Vendor: Debian OS: Linux
 
  sudo apt install  groovy groovy-doc  #Groovy Version: 2.4.21 JVM: 11.0.8 Vendor: Debian OS: Linux
  
第8行: 第8行:
 
当然也可以直接创建.groovy文件用命令行直接运行。
 
当然也可以直接创建.groovy文件用命令行直接运行。
  
 +
[https://www.qikqiak.com/post/groovy-simple-tutorial/ Groovy 简明教程]
 +
==hello world==
 +
<pre>
 +
emacs    e.groovy
 +
class Example {
 +
  static void main(String[] args) {
 +
      // Using a simple println statement to print output to the console
 +
      println('Hello World');
 +
  }
 +
}
 +
 +
 +
groovy  e.groovy
 +
 +
Hello World</pre>
 +
 +
==注释annotations==
 +
多行注释
 +
 +
多行注释以/*开头,并且能在行的任何位置 。以/*开头,包括新的行,直到第一个*/结束都被认为是注释的部分。多行注释可以放于声明的开始或者声明的中间。
 +
 +
[https://www.w3cschool.cn/groovy/groovy_annotations.html Groovy 注释]
 +
 +
==map==
 +
<pre>
 +
evan@myxps:~/tmp$ cat 2.groovy
 +
def  http=[:]
 +
println http.size()
 +
http['syn'] = 'helo'
 +
println http['syn']
 +
println http.size()
 +
 +
</pre>
 +
 +
https://www.cnblogs.com/jyan/archive/2012/05/30/2526372.html
 +
 +
 +
[https://blog.csdn.net/dora_310/article/details/52877750  Groovy集合(map)]
 +
 +
==Groovy函数调用 ==
 +
 +
[https://blog.csdn.net/qfanmingyiq/article/details/106028568  Groovy函数调用]
 +
 +
 +
[https://iowiki.com/groovy/groovy_methods.html Groovy - 方法(Methods)]
 +
 +
=jenkins and groovy =
 +
 +
[https://blog.csdn.net/gzh8579/article/details/59522469 Jenkins插件groovy-postbuild使用(一)-获取jenkins环境变量值和获取build结果]
 
=see also=
 
=see also=
 +
[https://www.qikqiak.com/post/groovy-simple-tutorial/ Groovy 简明教程]
 +
 +
 +
[https://www.w3cschool.cn/groovy/ Groovy 教程]
 +
 +
[https://www.jianshu.com/p/e8dec95c4326 Groovy 语言快速入门]
 +
 +
[https://www.jianshu.com/p/2c6b95097b2c Groovy简介与使用]
 +
 
[https://www.zhihu.com/question/22870020 为什么Groovy语言火不起来?]
 
[https://www.zhihu.com/question/22870020 为什么Groovy语言火不起来?]
 +
 +
[https://blog.csdn.net/cyh1111/article/details/4128062  Groovy是什么?]

2022年8月5日 (五) 02:40的最新版本

install

sudo apt install  groovy groovy-doc  #Groovy Version: 2.4.21 JVM: 11.0.8 Vendor: Debian OS: Linux

https://www.osradar.com/install-apache-groovy-ubuntu-debian/

usage

当然也可以直接创建.groovy文件用命令行直接运行。

Groovy 简明教程

hello world

emacs    e.groovy
class Example {
   static void main(String[] args) {
      // Using a simple println statement to print output to the console
      println('Hello World');
   }
}


groovy  e.groovy

Hello World

注释annotations

多行注释 

多行注释以/*开头,并且能在行的任何位置 。以/*开头,包括新的行,直到第一个*/结束都被认为是注释的部分。多行注释可以放于声明的开始或者声明的中间。

Groovy 注释

map

evan@myxps:~/tmp$ cat 2.groovy 
def  http=[:]
println http.size()
http['syn'] = 'helo'
println http['syn']
println http.size()

https://www.cnblogs.com/jyan/archive/2012/05/30/2526372.html


Groovy集合(map)

Groovy函数调用

Groovy函数调用


Groovy - 方法(Methods)

jenkins and groovy

Jenkins插件groovy-postbuild使用(一)-获取jenkins环境变量值和获取build结果

see also

Groovy 简明教程


Groovy 教程

Groovy 语言快速入门

Groovy简介与使用

为什么Groovy语言火不起来?

Groovy是什么?