Sfoglia il codice sorgente

Rework Marlin's versioning system

João Brázio 8 anni fa
parent
commit
170f7e8a45
Nessun account collegato all'indirizzo email del committer

+ 8
- 2
LinuxAddons/bin/generate_version_header_for_marlin Vedi File

@@ -9,8 +9,16 @@ echo " * It does not get committed to the repository" >>"$OUTFILE"
9 9
 echo " */" >>"$OUTFILE"
10 10
 echo "" >>"$OUTFILE"
11 11
 
12
+echo "#define PROTOCOL_VERSION \"1.0\"" >>"$OUTFILE"
13
+echo "#define DEFAULT_SOURCE_URL \"https://github.com/MarlinFirmware/Marlin\"" >>"$OUTFILE"
14
+echo "#define DEFAULT_MACHINE_NAME \"Travis 3D Printer\"" >>"$OUTFILE"
15
+echo "#define DEFAULT_MACHINE_UUID \"3442baa1-08ee-435b-8a10-99d185bd43b8\"" >>"$OUTFILE"
16
+echo "" >>"$OUTFILE"
17
+
12 18
 echo "#define BUILD_UNIX_DATETIME" `date +%s` >>"$OUTFILE"
13 19
 echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE"
20
+echo "" >>"$OUTFILE"
21
+
14 22
 ( set +e
15 23
   cd "$DIR"
16 24
   BRANCH=`git symbolic-ref -q --short HEAD`
@@ -33,7 +41,5 @@ echo "#define STRING_DISTRIBUTION_DATE" `date '+"%Y-%m-%d %H:%M"'` >>"$OUTFILE"
33 41
   URL=`git config --local --get remote.origin.url | sed "sx.*github.com.xhttps://github.com/x" | sed "sx\.gitx/x"`
34 42
   if [ "x$URL" != "x" ] ; then
35 43
     echo "#define SOURCE_CODE_URL  \""$URL"\"" >>"$OUTFILE"
36
-    echo "// Deprecated URL definition" >>"$OUTFILE"
37
-    echo "#define FIRMWARE_URL  \""$URL"\"" >>"$OUTFILE"
38 44
   fi
39 45
 )

+ 1
- 1
Marlin/Configuration.h Vedi File

@@ -76,7 +76,7 @@
76 76
 #if ENABLED(USE_AUTOMATIC_VERSIONING)
77 77
   #include "_Version.h"
78 78
 #else
79
-  #include "Default_Version.h"
79
+  #include "Version.h"
80 80
 #endif
81 81
 
82 82
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during

+ 0
- 36
Marlin/Default_Version.h Vedi File

@@ -1,36 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * This file is a placeholder for a file which could be distributed in an archive
25
- * It takes the place of an automatically created "_Version.h" which is generated during the build process
26
- */
27
-
28
-// #error "You must specify the following parameters related to your distribution"
29
-
30
-#if true
31
-#define SHORT_BUILD_VERSION "1.1.0-RCBugFix"
32
-#define DETAILED_BUILD_VERSION "1.1.0-RCBugFix From Archive"
33
-#define STRING_DISTRIBUTION_DATE "2016-04-16 12:00"
34
-// It might also be appropriate to define a location where additional information can be found
35
-// #define SOURCE_CODE_URL  "http:// ..."
36
-#endif

+ 35
- 0
Marlin/SanityCheck.h Vedi File

@@ -39,6 +39,41 @@
39 39
 #endif
40 40
 
41 41
 /**
42
+ * Marlin release, version and default string
43
+ */
44
+#ifndef SHORT_BUILD_VERSION
45
+  #error SHORT_BUILD_VERSION Information must be specified
46
+#endif
47
+
48
+#ifndef DETAILED_BUILD_VERSION
49
+  #error BUILD_VERSION Information must be specified
50
+#endif
51
+
52
+#ifndef STRING_DISTRIBUTION_DATE
53
+  #error STRING_DISTRIBUTION_DATE Information must be specified
54
+#endif
55
+
56
+#ifndef PROTOCOL_VERSION
57
+  #error PROTOCOL_VERSION Information must be specified
58
+#endif
59
+
60
+#ifndef MACHINE_NAME
61
+  #error MACHINE_NAME Information must be specified
62
+#endif
63
+
64
+#ifndef SOURCE_CODE_URL
65
+  #error SOURCE_CODE_URL Information must be specified
66
+#endif
67
+
68
+#ifndef DEFAULT_MACHINE_UUID
69
+  #error DEFAULT_MACHINE_UUID Information must be specified
70
+#endif
71
+
72
+#ifndef WEBSITE_URL
73
+  #error WEBSITE_URL Information must be specified
74
+#endif
75
+
76
+/**
42 77
  * Dual Stepper Drivers
43 78
  */
44 79
 #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && ENABLED(Y_DUAL_STEPPER_DRIVERS)

+ 74
- 0
Marlin/Version.h Vedi File

@@ -0,0 +1,74 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * This file is the standard Marlin version identifier file, all fields can be
25
+ * overriden by the ones defined on _Version.h by using the Configuration.h
26
+ * directive USE_AUTOMATIC_VERSIONING.
27
+ */
28
+
29
+/**
30
+ * Marlin release version identifier
31
+ */
32
+#define SHORT_BUILD_VERSION "1.1.0-RCBugFix"
33
+
34
+/**
35
+ * Verbose version identifier which should contain a reference to the location
36
+ * from where the binary was downloaded or the source code was compiled.
37
+ */
38
+#define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)"
39
+
40
+/**
41
+ * The STRING_DISTRIBUTION_DATE represents when the binary file was built,
42
+ * here we define this default string as the date where the latest release
43
+ * version was tagged.
44
+ */
45
+#define STRING_DISTRIBUTION_DATE "2016-04-16 12:00"
46
+
47
+/**
48
+ * @todo: Missing documentation block
49
+ */
50
+#define PROTOCOL_VERSION "1.0"
51
+
52
+/**
53
+ * Defines a generic printer name to be output to the LCD after booting Marlin.
54
+ */
55
+#define MACHINE_NAME "3D Printer"
56
+
57
+/**
58
+ * The SOURCE_CODE_URL is the location where users will find the Marlin Source
59
+ * Code which is installed on the device. In most cases —unless the manufacturer
60
+ * has a distinct Github fork— the Source Code URL should just be the main
61
+ * Marlin repository.
62
+ */
63
+#define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin"
64
+
65
+/**
66
+ * Default generic printer UUID.
67
+ */
68
+#define DEFAULT_MACHINE_UUID "cede2a2f-41a2-4748-9b12-c55c62f367ff"
69
+
70
+/**
71
+ * The WEBSITE_URL is the location where users can get more information such as
72
+ * documentation about a specific Marlin release.
73
+ */
74
+#define WEBSITE_URL "http://marlinfw.org"

+ 14
- 25
Marlin/language.h Vedi File

@@ -66,43 +66,32 @@
66 66
 #if ENABLED(USE_AUTOMATIC_VERSIONING)
67 67
   #include "_Version.h"
68 68
 #else
69
-  #include "Default_Version.h"
69
+  #include "Version.h"
70 70
 #endif
71 71
 
72
-#define PROTOCOL_VERSION "1.0"
73
-
74
-#ifndef DEFAULT_MACHINE_NAME
75
-  #define DEFAULT_MACHINE_NAME "3D Printer"
72
+#ifdef DEFAULT_SOURCE_CODE_URL
73
+  #undef  SOURCE_CODE_URL
74
+  #define SOURCE_CODE_URL DEFAULT_SOURCE_CODE_URL
76 75
 #endif
77 76
 
78 77
 #ifdef CUSTOM_MACHINE_NAME
78
+  #undef  MACHINE_NAME
79 79
   #define MACHINE_NAME CUSTOM_MACHINE_NAME
80 80
 #else
81
-  #define MACHINE_NAME DEFAULT_MACHINE_NAME
82
-#endif
83
-
84
-#ifndef DEFAULT_SOURCE_URL
85
-  /**
86
-   * The SOURCE_CODE_URL is the location where users will find the Marlin Source
87
-   * Code which is installed on the device. In most cases —unless the manufacturer
88
-   * has a distinct Github fork— the Source Code URL should just be the main
89
-   * Marlin repository.
90
-   */
91
-  #define DEFAULT_SOURCE_URL "https://github.com/MarlinFirmware/Marlin"
92
-#endif
93
-
94
-#ifndef SOURCE_CODE_URL
95
-  #define SOURCE_CODE_URL DEFAULT_SOURCE_URL
96
-#endif
97
-
98
-#ifndef DETAILED_BUILD_VERSION
99
-  #error BUILD_VERSION Information must be specified
81
+  #ifdef DEFAULT_MACHINE_NAME
82
+    #undef  MACHINE_NAME
83
+    #define MACHINE_NAME DEFAULT_MACHINE_NAME
84
+  #endif
100 85
 #endif
101 86
 
102 87
 #ifndef MACHINE_UUID
103
-  #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
88
+  #define MACHINE_UUID DEFAULT_MACHINE_UUID
104 89
 #endif
105 90
 
91
+#ifdef DEFAULT_WEBSITE_URL
92
+  #undef  WEBSITE_URL
93
+  #define WEBSITE_URL DEFAULT_WEBSITE_URL
94
+#endif
106 95
 
107 96
 // Common LCD messages
108 97
 

Loading…
Annulla
Salva