build.gradle 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. repositories {
  4. maven { url 'https://maven.aliyun.com/repository/central' }
  5. maven { url 'https://maven.aliyun.com/repository/public'}
  6. maven { url 'https://maven.aliyun.com/repository/google'} //替换google()
  7. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  8. gradlePluginPortal()
  9. google()
  10. mavenCentral()
  11. maven { url "https://jitpack.io" }
  12. }
  13. dependencies {
  14. classpath 'com.android.tools.build:gradle:7.2.1'
  15. // NOTE: Do not place your application dependencies here; they belong
  16. // in the individual module build.gradle files
  17. }
  18. }
  19. allprojects {
  20. repositories {
  21. maven { url 'https://maven.aliyun.com/repository/central' }
  22. maven { url 'https://maven.aliyun.com/repository/public'}
  23. maven { url 'https://maven.aliyun.com/repository/google'} //替换google()
  24. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  25. gradlePluginPortal()
  26. google()
  27. mavenCentral()
  28. maven { url "https://jitpack.io" }
  29. }
  30. gradle.projectsEvaluated {
  31. tasks.withType(JavaCompile) {
  32. options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
  33. }
  34. }
  35. }
  36. task clean(type: Delete) {
  37. delete rootProject.buildDir
  38. }
  39. ext {
  40. android = [
  41. buildTime : getBuildTime(),
  42. //buildTime : "\""+20241221145454+"\"",
  43. validDays : "30",
  44. ]
  45. }
  46. String getBuildTime() {
  47. Date date = new Date();
  48. String dateStr = "\""+date.format("yyyyMMddHHmmss")+"\"";
  49. System.out.println("build time:"+dateStr);
  50. return dateStr;
  51. }