How will I able to get the system variables to print in gradle? Like the computer name as $user.name and todays date
If you are referring to environment variables, then you can access them in the same way as Groovy/Java, using the System class.
For example:
println System.getenv( 'MY_VAR' )
I got username to work. By using println System.getenv USERNAME.
Basically I got to go to system environment and add it.
But I cant get Todays date, build number, release number to work because I don’t know what to fill in for the variable values.
Could you describe a bit more about what you are trying to accomplish?
I’m trying to use system var to print out Today’s date.
You also mentioned build and release numbers which made me think you were trying to accomplish something CI related (ie Jenkins builds).
You could use instances of the Date class instead of environment variables:
println new Date()
Groovy also offers some enhancements to the Date class. Here are some examples.