You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _drafts/2019-09-16-gradle.md
+133-9Lines changed: 133 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,20 +23,144 @@ Informacje nt konfiguracji znajdują sie w kilku plikach projektu. Używają one
23
23
24
24
`settings.gradle` deklaruje moduły, które powinny wziąć udział w procesie budowania projektu
25
25
26
-
//TODO
26
+
{% highlight gradle %}
27
+
include ':app', ':module1', ':module2'
28
+
{% endhighlight %}
27
29
28
-
`build.gradle` znajdujący się w głównym katalogu definuje konfigurację wspólną dla wszystkich modułów w projekcie
30
+
`build.gradle` znajdujący się w głównym katalogu definuje konfigurację wspólną dla wszystkich modułów w projekcie, np. repozytoria i wersja `Sdk`
29
31
30
-
//TODO
32
+
{% highlight gradle %}
33
+
// Configure the repositories and dependencies needed for Gradle itself in buildscript block
34
+
buildscript {
31
35
32
-
`build.gradle` znajdujący się w każdym module pozwala na specyficzną konfiguracje dla danego modułu uzupełniając lub nadpisując definicję `build.gradle` projektu
36
+
//Define some shared properties
37
+
ext {
38
+
compileSdkVersion = 28
39
+
supportLibVersion = "28.0.0"
40
+
kotlin_version = '1.3.31'
41
+
}
33
42
34
-
//TODO
43
+
// Pass repositories for Gradle to search and download dependencies
44
+
repositories {
45
+
google()
46
+
jcenter()
47
+
}
35
48
36
-
`gradle.properties` określa ustawienia Gradle dla całego projektu, takie jak np. maksymalna wielkość stosu demona Gradle
// Configure the global repositories and depenendencies used by all modules
57
+
allprojects {
58
+
repositories {
59
+
google()
60
+
jcenter()
61
+
}
62
+
}
39
63
40
-
`local.properties` konfiguruje lokalne właściwości środowiska dla systemu kompilacji, takie jak np. ścieżka instalacji SDK
64
+
// Create some tasks if needed
65
+
task clean(type: Delete) {
66
+
delete rootProject.buildDir
67
+
}
68
+
{% endhighlight %}
41
69
42
-
//TODO
70
+
`build.gradle` znajdujący się w każdym module pozwala na specyficzną konfiguracje dla danego modułu uzupełniając lub nadpisując definicję `build.gradle` projektu, np. zależności, wtyczki czy konfiguracja wersji i wariantów budowanej paczki `APK`
71
+
72
+
{% highlight gradle %}
73
+
//apply plugins to build and makes android block available to build options
74
+
apply plugin: 'com.android.application'
75
+
apply plugin: 'kotlin-android'
76
+
apply plugin: 'kotlin-android-extensions'
77
+
78
+
// Configure Android specific build options
79
+
android {
80
+
81
+
// Define some compile and build properties
82
+
compileSdkVersion 28
83
+
84
+
// Specify default settings and entries for all build variant
0 commit comments